From 01285eaf68709672862d98afd19cb8d61800a4c4 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 15 Sep 2010 16:14:40 +0300 Subject: [PATCH] Refresh libusual --- lib | 2 +- src/objects.c | 12 ++++++------ src/varcache.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib b/lib index 2ee987f..4ccc2c4 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit 2ee987fc7f7198ff1f4aaf771160e366df2339f9 +Subproject commit 4ccc2c438e843b34dd6d11a597f86804595cdf4d diff --git a/src/objects.c b/src/objects.c index b55c9f8..faddcec 100644 --- a/src/objects.c +++ b/src/objects.c @@ -98,9 +98,9 @@ static int user_node_cmp(long userptr, struct AANode *node) void init_objects(void) { aatree_init(&user_tree, user_node_cmp, NULL); - user_cache = slab_create("user_cache", sizeof(PgUser), 0, NULL); - db_cache = slab_create("db_cache", sizeof(PgDatabase), 0, NULL); - pool_cache = slab_create("pool_cache", sizeof(PgPool), 0, NULL); + user_cache = slab_create("user_cache", sizeof(PgUser), 0, NULL, USUAL_ALLOC); + db_cache = slab_create("db_cache", sizeof(PgDatabase), 0, NULL, USUAL_ALLOC); + pool_cache = slab_create("pool_cache", sizeof(PgPool), 0, NULL, USUAL_ALLOC); if (!user_cache || !db_cache || !pool_cache) fatal("cannot create initial caches"); @@ -115,9 +115,9 @@ static void do_iobuf_reset(void *arg) /* initialization after config loading */ void init_caches(void) { - server_cache = slab_create("server_cache", sizeof(PgSocket), 0, construct_server); - client_cache = slab_create("client_cache", sizeof(PgSocket), 0, construct_client); - iobuf_cache = slab_create("iobuf_cache", IOBUF_SIZE, 0, do_iobuf_reset); + server_cache = slab_create("server_cache", sizeof(PgSocket), 0, construct_server, USUAL_ALLOC); + client_cache = slab_create("client_cache", sizeof(PgSocket), 0, construct_client, USUAL_ALLOC); + iobuf_cache = slab_create("iobuf_cache", IOBUF_SIZE, 0, do_iobuf_reset, USUAL_ALLOC); } /* state change means moving between lists */ diff --git a/src/varcache.c b/src/varcache.c index 3547bb5..9bc14f2 100644 --- a/src/varcache.c +++ b/src/varcache.c @@ -51,7 +51,7 @@ bool varcache_set(VarCache *cache, const char *key, const char *value) struct PStr *pstr = NULL; if (!vpool) { - vpool = strpool_create(); + vpool = strpool_create(USUAL_ALLOC); if (!vpool) return false; } -- 2.40.0