mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
Disable refcounting test code when not in use
This commit is contained in:
parent
c5663e3538
commit
101ac69de2
1 changed files with 13 additions and 10 deletions
|
@ -87,6 +87,8 @@ void *roc_realloc(void *ptr, size_t new_size, size_t old_size,
|
||||||
//--------------------------
|
//--------------------------
|
||||||
|
|
||||||
void roc_dealloc(void *ptr, unsigned int alignment)
|
void roc_dealloc(void *ptr, unsigned int alignment)
|
||||||
|
{
|
||||||
|
if (rc_pointers)
|
||||||
{
|
{
|
||||||
// Null out the entry in the test array to indicate that it was freed
|
// Null out the entry in the test array to indicate that it was freed
|
||||||
// Then even if malloc reuses the space, everything still works
|
// Then even if malloc reuses the space, everything still works
|
||||||
|
@ -102,6 +104,7 @@ void roc_dealloc(void *ptr, unsigned int alignment)
|
||||||
}
|
}
|
||||||
int was_found = i < rc_pointers_index;
|
int was_found = i < rc_pointers_index;
|
||||||
ASSERT(was_found);
|
ASSERT(was_found);
|
||||||
|
}
|
||||||
|
|
||||||
#if ENABLE_PRINTF
|
#if ENABLE_PRINTF
|
||||||
printf("roc_dealloc deallocated %p with alignment %zd\n", ptr, alignment);
|
printf("roc_dealloc deallocated %p with alignment %zd\n", ptr, alignment);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue