From 324ba5d256723b31faedb1698a4c8297228ec34d Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Wed, 19 Mar 2025 20:57:44 +0100 Subject: [PATCH] Port to new memory model: M_MEMORY_FULL cannot return anymore --- m-bptree.h | 1 - m-bstring.h | 3 --- m-c-mempool.h | 1 - 3 files changed, 5 deletions(-) diff --git a/m-bptree.h b/m-bptree.h index a10af74c..68c6449f 100644 --- a/m-bptree.h +++ b/m-bptree.h @@ -414,7 +414,6 @@ node_t n = M_CALL_NEW(key_oplist, struct M_F(name, _node_s)); \ if (M_UNLIKELY_NOMEM (n == NULL)) { \ M_MEMORY_FULL(node_t, 1); \ - M_ASSERT (0); \ } \ n->next = NULL; \ n->num = 0; \ diff --git a/m-bstring.h b/m-bstring.h index 40338ada..fe984b06 100644 --- a/m-bstring.h +++ b/m-bstring.h @@ -179,9 +179,6 @@ M_P(uint8_t *, m_bstr1ng, _fit2size, m_bstring_t v, size_t size_alloc, bool exac return &v->ptr[v->offset]; allocation_error: M_MEMORY_FULL(uint8_t, size_alloc); - // NOTE: Return is currently broken. - abort(); - return NULL; } /* Push the byte 'c' in the bstring 'v' */ diff --git a/m-c-mempool.h b/m-c-mempool.h index cc7aa6fa..d2059016 100644 --- a/m-c-mempool.h +++ b/m-c-mempool.h @@ -756,7 +756,6 @@ m_vlapool_init(m_vlapool_t mem, m_gc_t gc_mem) mem->thread_data = M_MEMORY_REALLOC(m_vlapool_lfmp_thread_ct, NULL, 0, max_thread); if (M_UNLIKELY_NOMEM (mem->thread_data == NULL)) { M_MEMORY_FULL(m_vlapool_lfmp_thread_ct, max_thread); - return; } for(unsigned i = 0; i < max_thread;i++) { m_vlapool_lfmp_thread_init(&mem->thread_data[i]);