1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-28 10:44:26 +01:00

Fixes #116: Allow overrides of the Unity Fixture's memory functions. This enables custom heap implementations to be used with the Unity Fixture.

This commit is contained in:
Andrew Burks
2015-06-30 15:32:57 -07:00
parent 31b1255663
commit 7737fee444
2 changed files with 24 additions and 2 deletions

View File

@@ -196,7 +196,7 @@ void * unity_malloc(size_t size)
malloc_count++;
guard = (Guard*)malloc(size + sizeof(Guard) + 4);
guard = (Guard*)UNITY_FIXTURE_MALLOC(size + sizeof(Guard) + 4);
guard->size = size;
mem = (char*)&(guard[1]);
memcpy(&mem[size], end, strlen(end) + 1);
@@ -219,7 +219,7 @@ static void release_memory(void * mem)
guard--;
malloc_count--;
free(guard);
UNITY_FIXTURE_FREE(guard);
}
void unity_free(void * mem)