From: xurui Date: Mon, 10 Apr 2023 08:05:33 +0000 (+0800) Subject: zink: Use malloc instead of ralloc X-Git-Tag: upstream/23.3.3~9800 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f89c85e5d0172243d62f9a19e04361000b3ad530;p=platform%2Fupstream%2Fmesa.git zink: Use malloc instead of ralloc ralloc is less performant most of the time when the object doesn't have sets/hashtables attached Use malloc instead of ralloc in zink_descriptors.c Signed-off-by: xurui Reviewed-by: Mike Blumenkrantz Part-of: --- diff --git a/src/gallium/drivers/zink/zink_descriptors.c b/src/gallium/drivers/zink/zink_descriptors.c index 2dab523..a79580b 100644 --- a/src/gallium/drivers/zink/zink_descriptors.c +++ b/src/gallium/drivers/zink/zink_descriptors.c @@ -784,7 +784,7 @@ static void pool_destroy(struct zink_screen *screen, struct zink_descriptor_pool *pool) { VKSCR(DestroyDescriptorPool)(screen->dev, pool->pool, NULL); - ralloc_free(pool); + FREE(pool); } static void @@ -792,7 +792,7 @@ multi_pool_destroy(struct zink_screen *screen, struct zink_descriptor_pool_multi { if (mpool->pool) pool_destroy(screen, mpool->pool); - ralloc_free(mpool); + FREE(mpool); } static bool @@ -855,13 +855,13 @@ set_pool(struct zink_batch_state *bs, struct zink_program *pg, struct zink_descr static struct zink_descriptor_pool * alloc_new_pool(struct zink_screen *screen, struct zink_descriptor_pool_multi *mpool) { - struct zink_descriptor_pool *pool = rzalloc(mpool, struct zink_descriptor_pool); + struct zink_descriptor_pool *pool = CALLOC_STRUCT(zink_descriptor_pool); if (!pool) return NULL; const unsigned num_type_sizes = mpool->pool_key->sizes[1].descriptorCount ? 2 : 1; pool->pool = create_pool(screen, num_type_sizes, mpool->pool_key->sizes, 0); if (!pool->pool) { - ralloc_free(pool); + FREE(pool); return NULL; } return pool; @@ -943,7 +943,7 @@ check_pool_alloc(struct zink_context *ctx, struct zink_descriptor_pool_multi *mp static struct zink_descriptor_pool * create_push_pool(struct zink_screen *screen, struct zink_batch_state *bs, bool is_compute, bool has_fbfetch) { - struct zink_descriptor_pool *pool = rzalloc(bs, struct zink_descriptor_pool); + struct zink_descriptor_pool *pool = CALLOC_STRUCT(zink_descriptor_pool); VkDescriptorPoolSize sizes[2]; sizes[0].type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; if (is_compute) @@ -998,11 +998,11 @@ get_descriptor_pool(struct zink_context *ctx, struct zink_program *pg, enum zink NULL; if (mppool && *mppool) return check_pool_alloc(ctx, *mppool, pg, type, bs, is_compute); - struct zink_descriptor_pool_multi *mpool = rzalloc(bs, struct zink_descriptor_pool_multi); + struct zink_descriptor_pool_multi *mpool = CALLOC_STRUCT(zink_descriptor_pool_multi); if (!mpool) return NULL; - util_dynarray_init(&mpool->overflowed_pools[0], mpool); - util_dynarray_init(&mpool->overflowed_pools[1], mpool); + util_dynarray_init(&mpool->overflowed_pools[0], NULL); + util_dynarray_init(&mpool->overflowed_pools[1], NULL); mpool->pool_key = pool_key; if (!set_pool(bs, pg, mpool, type)) { multi_pool_destroy(screen, mpool);