diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2014-05-30 19:03:33 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2014-05-30 19:03:33 -0400 |
commit | 8807ab192b36acbc94e11790e9261c799ce77892 (patch) | |
tree | 7b37684cb5679c132d21f3bd8c2ff47a11e3df55 /libdimension/pattern.c | |
parent | 4781d3a2a7ec463ee712c8de6362d8b6c872c31b (diff) | |
download | dimension-8807ab192b36acbc94e11790e9261c799ce77892.tar.xz |
pattern: Use pool.
Diffstat (limited to 'libdimension/pattern.c')
-rw-r--r-- | libdimension/pattern.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/libdimension/pattern.c b/libdimension/pattern.c index 56c7c48..22f5c13 100644 --- a/libdimension/pattern.c +++ b/libdimension/pattern.c @@ -25,39 +25,19 @@ #include "dimension-internal.h" -static void -dmnsn_default_pattern_free_fn(dmnsn_pattern *pattern) -{ - dmnsn_free(pattern); -} - -/* Allocate a dummy pattern */ dmnsn_pattern * -dmnsn_new_pattern(void) +dmnsn_new_pattern(dmnsn_pool *pool) { - dmnsn_pattern *pattern = DMNSN_MALLOC(dmnsn_pattern); + dmnsn_pattern *pattern = DMNSN_PALLOC(pool, dmnsn_pattern); dmnsn_init_pattern(pattern); return pattern; } -/* Initialize a pattern */ void dmnsn_init_pattern(dmnsn_pattern *pattern) { - pattern->free_fn = dmnsn_default_pattern_free_fn; - DMNSN_REFCOUNT_INIT(pattern); -} - -/* Delete a pattern */ -void -dmnsn_delete_pattern(dmnsn_pattern *pattern) -{ - if (DMNSN_DECREF(pattern)) { - pattern->free_fn(pattern); - } } -/* Invoke the pattern callback with the right transformation */ double dmnsn_pattern_value(const dmnsn_pattern *pattern, dmnsn_vector v) { |