Add alloc/dealloc memory

* Allow memory alloc and dealloc on debug (APPLE ONLY)