By using mach_make_memory_entry, allocated memory was still being retained after vm_deallocate, never allowing any TPCircularBuffer to free memory.
This pull request switches it to the simpler vm_remap and fixes the leak. Also adds retrying to address the potential race condition that could lead to non-contiguous allocation.
By using mach_make_memory_entry, allocated memory was still being retained after vm_deallocate, never allowing any TPCircularBuffer to free memory.
This pull request switches it to the simpler vm_remap and fixes the leak. Also adds retrying to address the potential race condition that could lead to non-contiguous allocation.
If you're curious, the original bug can be seen in this example project: http://dl.dropbox.com/u/19471040/AllocTest.zip