]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: opentracing: use pool_alloc(), not pool_alloc_dirty()
authorWilly Tarreau <w@1wt.eu>
Mon, 22 Mar 2021 14:10:51 +0000 (15:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 22 Mar 2021 14:35:53 +0000 (15:35 +0100)
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

index 2f4b5341161b09ffe89955edf5c315386f2c7353..ead53e1b8be53554e093223ffe7bd55bc246f1c0 100644 (file)
@@ -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));