From 795600a44b03fcd52c055981a403ad60ee5d027a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Wed, 22 Nov 2023 19:38:09 +0100 Subject: [PATCH] cache: don't reject pl_cache_obj with custom allocator --- src/cache.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cache.h b/src/cache.h index 485b575b..7e0ff2f5 100644 --- a/src/cache.h +++ b/src/cache.h @@ -37,8 +37,8 @@ static inline void pl_cache_str(pl_cache cache, uint64_t key, pl_str *str) // Steal and insert a cache object static inline void pl_cache_steal(pl_cache cache, pl_cache_obj *obj) { - pl_assert(!obj->data || obj->free == pl_free); - obj->data = pl_steal(NULL, obj->data); + if (obj->free == pl_free) + obj->data = pl_steal(NULL, obj->data); pl_cache_set(cache, obj); }