Function - Shut down a memory object.
kern_return_t memory_object_destroy (memory_object_control_t memory_control, kern_return_t reason);
The memory_object_destroy function tells the kernel to shut down the specified memory object. As a result of this call, the kernel no longer supports paging activity or any memory object calls on the memory object. The kernel issues a memory_object_terminate call to pass to the memory manager all rights to the memory object port and the memory control port.
To ensure that any modified cached data is returned before the object is terminated, the memory manager should call memory_object_lock_request with should_flush set and a lock value of VM_PROT_WRITE before it makes the memory_object_destroy call.
The reason code is currently ignored by the kernel.
Only generic errors apply.
Functions: memory_object_lock_request, memory_object_terminate.