diff --git a/include/haproxy/pool-t.h b/include/haproxy/pool-t.h index d49982165f..abc3203432 100644 --- a/include/haproxy/pool-t.h +++ b/include/haproxy/pool-t.h @@ -50,14 +50,7 @@ #define CONFIG_HAP_NO_GLOBAL_POOLS #endif -/* Pools of very similar size are shared by default, unless macro - * DEBUG_DONT_SHARE_POOLS is set. - */ -#ifndef DEBUG_DONT_SHARE_POOLS #define MEM_F_SHARED 0x1 -#else -#define MEM_F_SHARED 0 -#endif #define MEM_F_EXACT 0x2 /* By default, free objects are linked by a pointer stored at the beginning of diff --git a/src/pool.c b/src/pool.c index 2233750623..3cca6c7a29 100644 --- a/src/pool.c +++ b/src/pool.c @@ -80,7 +80,11 @@ struct pool_head *create_pool(char *name, unsigned int size, unsigned int flags) * we look for a shareable one or for the next position * before which we will insert a new one. */ - if (flags & entry->flags & MEM_F_SHARED) { + if ((flags & entry->flags & MEM_F_SHARED) +#ifdef DEBUG_DONT_SHARE_POOLS + && strcmp(name, entry->name) == 0 +#endif + ) { /* we can share this one */ pool = entry; DPRINTF(stderr, "Sharing %s with %s\n", name, pool->name);