kernel/low_resource_manager: Use new/delete instead of malloc/free.

No functional change as-is, but this is necessary with some experimental
patches I am testing which add a lot more assertions to DoublyLinkedList,
which thus require it to have constructors/destructors for the Link class.
This commit is contained in:
Augustin Cavalier 2022-11-29 22:34:26 -05:00
parent f6166140a1
commit 549abba75f

View File

@ -449,7 +449,7 @@ unregister_low_resource_handler(low_resource_func function, void* data)
if (handler->function == function && handler->data == data) {
sLowResourceHandlers.Remove(handler);
free(handler);
delete handler;
return B_OK;
}
}
@ -468,8 +468,7 @@ register_low_resource_handler(low_resource_func function, void* data,
TRACE(("register_low_resource_handler(function = %p, data = %p)\n",
function, data));
low_resource_handler *newHandler = (low_resource_handler*)malloc(
sizeof(low_resource_handler));
low_resource_handler *newHandler = new low_resource_handler;
if (newHandler == NULL)
return B_NO_MEMORY;