/* * Destroy a User_Context object, including all memory * and other resources allocated within it. */ void Destroy_User_Context(struct User_Context* userContext) { Free(userContext->memory); Free_Segment_Descriptor(userContext->ldtDescriptor); Free(userContext); }
/* * Destroy a User_Context object, including all memory * and other resources allocated within it. */ void Destroy_User_Context(struct User_Context *userContext) { KASSERT(userContext->refCount == 0); /* Free the context's LDT descriptor */ Free_Segment_Descriptor(userContext->ldtDescriptor); /* Free the context's memory */ Disable_Interrupts(); Free(userContext->memory); Free(userContext); Enable_Interrupts(); }