diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-09-01 21:49:01 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-09-01 21:49:01 +0100 |
commit | b8ddd66cf6e0d16383580c3c3398343f577b89fd (patch) | |
tree | bf1b2cc96bdc146c63bf2c27fb6af1b8c6834581 | |
parent | 5a3fa29b370816acb3a08d60e4031ed82c1e4c73 (diff) |
Revert "[freelist] Make _cairo_freepool_alloc_from_new_pool static inline."
This reverts commit 5a3fa29b370816acb3a08d60e4031ed82c1e4c73 as it breaks
the boilerplate when linking with gcc.
-rw-r--r-- | src/cairo-freelist-private.h | 29 | ||||
-rw-r--r-- | src/cairo-freelist.c | 29 |
2 files changed, 31 insertions, 27 deletions
diff --git a/src/cairo-freelist-private.h b/src/cairo-freelist-private.h index 420fa333..d48a7201 100644 --- a/src/cairo-freelist-private.h +++ b/src/cairo-freelist-private.h @@ -22,7 +22,6 @@ #ifndef CAIRO_FREELIST_H #define CAIRO_FREELIST_H -#include "cairoint.h" #include "cairo-types-private.h" #include "cairo-compiler-private.h" @@ -97,32 +96,8 @@ _cairo_freepool_init (cairo_freepool_t *freepool, unsigned nodesize); cairo_private void _cairo_freepool_fini (cairo_freepool_t *freepool); -static inline void * -_cairo_freepool_alloc_from_new_pool (cairo_freepool_t *freepool) -{ - cairo_freelist_pool_t *pool; - int poolsize; - - if (freepool->pools != &freepool->embedded_pool) - poolsize = 2 * freepool->pools->size; - else - poolsize = (128 * freepool->nodesize + 8191) & -8192; - pool = malloc (sizeof (cairo_freelist_pool_t) + poolsize); - if (unlikely (pool == NULL)) - return pool; - - pool->next = freepool->pools; - freepool->pools = pool; - - pool->size = poolsize; - pool->rem = poolsize - freepool->nodesize; - pool->data = (uint8_t *) (pool + 1) + freepool->nodesize; - - VG (VALGRIND_MAKE_MEM_NOACCESS (pool->data, poolsize)); - VG (VALGRIND_MAKE_MEM_UNDEFINED (pool->data, freepool->nodesize)); - - return pool + 1; -} +cairo_private void * +_cairo_freepool_alloc_from_new_pool (cairo_freepool_t *freepool); static inline void * _cairo_freepool_alloc_from_pool (cairo_freepool_t *freepool) diff --git a/src/cairo-freelist.c b/src/cairo-freelist.c index e7f3ac2b..6277f907 100644 --- a/src/cairo-freelist.c +++ b/src/cairo-freelist.c @@ -20,6 +20,8 @@ * OF THIS SOFTWARE. */ +#include "cairoint.h" + #include "cairo-freelist-private.h" void @@ -109,3 +111,30 @@ _cairo_freepool_fini (cairo_freepool_t *freepool) } VG (VALGRIND_MAKE_MEM_NOACCESS (freepool, sizeof (freepool))); } + +void * +_cairo_freepool_alloc_from_new_pool (cairo_freepool_t *freepool) +{ + cairo_freelist_pool_t *pool; + int poolsize; + + if (freepool->pools != &freepool->embedded_pool) + poolsize = 2 * freepool->pools->size; + else + poolsize = (128 * freepool->nodesize + 8191) & -8192; + pool = malloc (sizeof (cairo_freelist_pool_t) + poolsize); + if (unlikely (pool == NULL)) + return pool; + + pool->next = freepool->pools; + freepool->pools = pool; + + pool->size = poolsize; + pool->rem = poolsize - freepool->nodesize; + pool->data = (uint8_t *) (pool + 1) + freepool->nodesize; + + VG (VALGRIND_MAKE_MEM_NOACCESS (pool->data, poolsize)); + VG (VALGRIND_MAKE_MEM_UNDEFINED (pool->data, freepool->nodesize)); + + return pool + 1; +} |