]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: spoe: use pool_alloc(), not pool_alloc_dirty()
authorWilly Tarreau <w@1wt.eu>
Mon, 22 Mar 2021 14:05:54 +0000 (15:05 +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 real benefit, it only avoids the
area being poisonned before being zeroed. Ideally a pool_calloc() function
should be provided for this.

src/flt_spoe.c

index 654f2699c5df6442e218d4b85fc8515b6832c398..0397470778df3bd3f17e30bc55febf9ce760c479 100644 (file)
@@ -1965,7 +1965,7 @@ spoe_create_appctx(struct spoe_config *conf)
        if ((appctx = appctx_new(&spoe_applet, tid_bit)) == NULL)
                goto out_error;
 
-       appctx->ctx.spoe.ptr = pool_alloc_dirty(pool_head_spoe_appctx);
+       appctx->ctx.spoe.ptr = pool_alloc(pool_head_spoe_appctx);
        if (SPOE_APPCTX(appctx) == NULL)
                goto out_free_appctx;
        memset(appctx->ctx.spoe.ptr, 0, pool_head_spoe_appctx->size);
@@ -2870,7 +2870,7 @@ spoe_create_context(struct stream *s, struct filter *filter)
        struct spoe_config  *conf = FLT_CONF(filter);
        struct spoe_context *ctx;
 
-       ctx = pool_alloc_dirty(pool_head_spoe_ctx);
+       ctx = pool_alloc(pool_head_spoe_ctx);
        if (ctx == NULL) {
                return NULL;
        }