Skip to content

Commit

Permalink
corec: inline MemHeap_Null()
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Jan 3, 2025
1 parent 235c9bb commit 13026f4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions corec/corec/array/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 13026f4

Please sign in to comment.