From cb01450688c98203107a765ae38eaadfa7e11feb Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 3 Jan 2025 17:49:05 +0100 Subject: [PATCH] corec: inline MemHeap_Null() --- corec/corec/array/array.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/corec/corec/array/array.c b/corec/corec/array/array.c index 7c9b1fe9..091f4776 100644 --- a/corec/corec/array/array.c +++ b/corec/corec/array/array.c @@ -18,13 +18,6 @@ typedef struct } datahead; -// get a "NULL" value to recover the cc_memheap of an array -static INLINE void *MemHeap_Null(const cc_memheap *p) -{ - if (p == NULL) - return NULL; - return (void*)(&p->Null+1); -} static INLINE dataheaphead* Data_HeapHead(const array *p) { @@ -123,7 +116,10 @@ static size_t ArraySize(const array*p) void ArrayInitEx(array* p,const cc_memheap* Heap) { - p->_Begin = MemHeap_Null(Heap); + if (Heap == NULL) + p->_Begin = NULL; + else + p->_Begin = (void*)(&Heap->Null+1); p->_Used = 0; }