## memory_object_terminate

Server Interface - Relinquish access to a memory object.

### SYNOPSIS

    kern_return_t   memory_object_terminate
                    (memory_object_t                  memory_object,
                     memory_object_control_t         memory_control);

    kern_return_t   seqnos_memory_object_terminate
                    (memory_object_t                  memory_object,
                     mach_port_seqno_t                        seqno,
                     memory_object_control_t         memory_control);

### PARAMETERS

memory_object
  [in abstract-memory-object (receive) right] The abstract memory object port that represents the memory object data.

seqno
  [in scalar] The sequence number of this message relative to the abstract memory object port.

memory_control
  [in memory-cache-control receive right] The memory cache control port to be used for a response by the memory manager. If the memory object has been supplied to more than one kernel, this parameter identifies the kernel that is making the call.

### DESCRIPTION

A memory_object_terminate function is called as the result of a kernel message notifying a memory manager that no mappings of the specified memory object remain. The kernel makes this call to allow the memory manager to clean up data structures associated with the deallocated mappings. The call provides receive rights to the memory cache control port so that the memory manager can retrieve any messages it sent into this port before knowing the memory object was being terminated and then destroy the port. The kernel also relinquishes its rights for all memory object ports.

The kernel terminates a memory object only after all address space mappings of the object have been deallocated, or upon explicit request by the memory manager.

### RETURN VALUES

Only generic errors apply.

### RELATED INFORMATION

Functions: memory_object_destroy, mach_port_deallocate, memory_object_server, seqnos_memory_object_server.