My solution would be allocating a global byte-array, that would be used instead of the heap (non melloc allocation) and you are free to use it as you want but you have to do memory management yourself:
char heap[MAX_ALLOWED_MEM];
/*
The following function uses 'heap' as raw memory!
void* like_malloc(size_t bytes);
...
*/
Check if you are ok with calloc, but internally both are same more or less.