michaeltyson/TPCircularBuffer — pull request #2 by signalsandstuff (2012-04-10 05:49:11+00:00)
Title: Fixed memory leak

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