diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-08-21 00:28:52 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-08-21 13:18:28 -0600 |
commit | 6b1fcde7af64ca81079dffe1d62096228693b5d6 (patch) | |
tree | 2600ece91b5179105a572d79b60a6fc07e82c0a7 /libdimension/timer.c | |
parent | 4f9a96f6cdee4cf234bde7fdafd0be0f5b6b808e (diff) | |
download | dimension-6b1fcde7af64ca81079dffe1d62096228693b5d6.tar.xz |
Don't dynamically allocate timers.
Diffstat (limited to 'libdimension/timer.c')
-rw-r--r-- | libdimension/timer.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/libdimension/timer.c b/libdimension/timer.c index ad0fd9b..e0873a8 100644 --- a/libdimension/timer.c +++ b/libdimension/timer.c @@ -25,17 +25,14 @@ #include "dimension-impl.h" -dmnsn_timer * -dmnsn_new_timer(void) +void +dmnsn_start_timer(dmnsn_timer *timer) { - dmnsn_timer *timer = dmnsn_malloc(sizeof(dmnsn_timer)); dmnsn_get_times(timer); - timer->refcount = 1; - return timer; } void -dmnsn_complete_timer(dmnsn_timer *timer) +dmnsn_stop_timer(dmnsn_timer *timer) { dmnsn_timer now; dmnsn_get_times(&now); @@ -43,11 +40,3 @@ dmnsn_complete_timer(dmnsn_timer *timer) timer->user = now.user - timer->user; timer->system = now.system - timer->system; } - -void -dmnsn_delete_timer(dmnsn_timer *timer) -{ - if (DMNSN_DECREF(timer)) { - dmnsn_free(timer); - } -} |