unsigned long long pool_total_used(void);
void pool_flush(struct pool_head *pool);
void pool_gc(struct pool_head *pool_ctx);
-struct pool_head *create_pool(const char *name, unsigned int size, unsigned int flags);
+struct pool_head *create_pool_with_loc(const char *name, unsigned int size, unsigned int flags, const char *file, unsigned int line);
struct pool_head *create_pool_from_reg(const char *name, struct pool_registration *reg);
void create_pool_callback(struct pool_head **ptr, char *name, struct pool_registration *reg);
void *pool_destroy(struct pool_head *pool);
void __pool_free(struct pool_head *pool, void *ptr);
void pool_inspect_item(const char *msg, struct pool_head *pool, const void *item, const void *caller, ssize_t ofs);
+#define create_pool(name, size, flags) \
+ create_pool_with_loc(name, size, flags, __FILE__, __LINE__)
+
/****************** Thread-local cache management ******************/
* - MEM_F_SHARED to indicate that the pool may be shared with other users
* - MEM_F_EXACT to indicate that the size must not be rounded up
* The name must be a stable pointer during all the program's life time.
+ * The file and line are passed to store the registration location in the
+ * registration struct. Use create_pool() instead which does it for free.
*/
-struct pool_head *create_pool(const char *name, unsigned int size, unsigned int flags)
+struct pool_head *create_pool_with_loc(const char *name, unsigned int size, unsigned int flags,
+ const char *file, unsigned int line)
{
struct pool_registration *reg;
struct pool_head *pool;
return NULL;
reg->name = name;
+ reg->file = file;
+ reg->line = line;
reg->size = size;
reg->flags = flags;
reg->align = 0;