From: Marko Kreen Date: Wed, 15 Sep 2010 13:14:40 +0000 (+0300) Subject: Refresh libusual X-Git-Tag: pgbouncer_1_4_rc3~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01285eaf68709672862d98afd19cb8d61800a4c4;p=pgbouncer Refresh libusual --- 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; }