From b7bf53e15004204e456fa552ebd82ba4245a01ff Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 22 Mar 2021 15:10:51 +0100 Subject: [PATCH] MINOR: opentracing: use pool_alloc(), not pool_alloc_dirty() pool_alloc_dirty() is the version below pool_alloc() that never performs the memory poisonning. It should only be called directly for very large unstructured areas for which enabling memory poisonning would not bring anything but could significantly hurt performance (e.g. buffers). Using this function here will not provide any benefit and will hurt the ability to debug. It would be desirable to backport this, although it does not cause any user-visible bug, it just complicates debugging. --- contrib/opentracing/src/pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/opentracing/src/pool.c b/contrib/opentracing/src/pool.c index 2f4b53411..ead53e1b8 100644 --- a/contrib/opentracing/src/pool.c +++ b/contrib/opentracing/src/pool.c @@ -43,7 +43,7 @@ void *flt_ot_pool_alloc(struct pool_head *pool, size_t size, bool flag_clear, ch FLT_OT_FUNC("%p, %zu, %hhu, %p:%p", pool, size, flag_clear, FLT_OT_DPTR_ARGS(err)); if (pool != NULL) { - retptr = pool_alloc_dirty(pool); + retptr = pool_alloc(pool); if (retptr != NULL) FLT_OT_DBG(2, "POOL_ALLOC: %s:%d(%p %zu)", __func__, __LINE__, retptr, FLT_OT_DEREF(pool, size, size)); } else { @@ -82,7 +82,7 @@ void *flt_ot_pool_strndup(struct pool_head *pool, const char *s, size_t size, ch FLT_OT_FUNC("%p, \"%.*s\", %zu, %p:%p", pool, (int)size, s, size, FLT_OT_DPTR_ARGS(err)); if (pool != NULL) { - retptr = pool_alloc_dirty(pool); + retptr = pool_alloc(pool); if (retptr != NULL) { (void)memcpy(retptr, s, MIN(pool->size - 1, size));