From: Willy Tarreau Date: Mon, 22 Mar 2021 14:10:51 +0000 (+0100) Subject: MINOR: opentracing: use pool_alloc(), not pool_alloc_dirty() X-Git-Tag: v2.4-dev14~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7bf53e15004204e456fa552ebd82ba4245a01ff;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/contrib/opentracing/src/pool.c b/contrib/opentracing/src/pool.c index 2f4b534116..ead53e1b8b 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));