From c10255ab3da17507d63bdc7e1fdfc809ffd32f7f Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 31 May 2014 13:54:56 -0400 Subject: pigment: Use pool. --- libdimension/pigment.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'libdimension/pigment.c') diff --git a/libdimension/pigment.c b/libdimension/pigment.c index e392d7b..5756087 100644 --- a/libdimension/pigment.c +++ b/libdimension/pigment.c @@ -25,17 +25,11 @@ #include "dimension-internal.h" -static void -dmnsn_default_pigment_free_fn(dmnsn_pigment *pigment) -{ - dmnsn_free(pigment); -} - /* Allocate a dummy pigment */ dmnsn_pigment * -dmnsn_new_pigment(void) +dmnsn_new_pigment(dmnsn_pool *pool) { - dmnsn_pigment *pigment = DMNSN_MALLOC(dmnsn_pigment); + dmnsn_pigment *pigment = DMNSN_PALLOC(pool, dmnsn_pigment); dmnsn_init_pigment(pigment); return pigment; } @@ -46,20 +40,9 @@ dmnsn_init_pigment(dmnsn_pigment *pigment) { pigment->pigment_fn = NULL; pigment->initialize_fn = NULL; - pigment->free_fn = dmnsn_default_pigment_free_fn; pigment->trans = dmnsn_identity_matrix(); pigment->quick_color = DMNSN_TCOLOR(dmnsn_black); pigment->initialized = false; - DMNSN_REFCOUNT_INIT(pigment); -} - -/* Free a pigment */ -void -dmnsn_delete_pigment(dmnsn_pigment *pigment) -{ - if (DMNSN_DECREF(pigment)) { - pigment->free_fn(pigment); - } } /* Precompute pigment properties */ -- cgit v1.2.3