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:
@@ -449,7 +449,7 @@ unregister_low_resource_handler(low_resource_func function, void* data)
|
|||||||
|
|
||||||
if (handler->function == function && handler->data == data) {
|
if (handler->function == function && handler->data == data) {
|
||||||
sLowResourceHandlers.Remove(handler);
|
sLowResourceHandlers.Remove(handler);
|
||||||
free(handler);
|
delete handler;
|
||||||
return B_OK;
|
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",
|
TRACE(("register_low_resource_handler(function = %p, data = %p)\n",
|
||||||
function, data));
|
function, data));
|
||||||
|
|
||||||
low_resource_handler *newHandler = (low_resource_handler*)malloc(
|
low_resource_handler *newHandler = new low_resource_handler;
|
||||||
sizeof(low_resource_handler));
|
|
||||||
if (newHandler == NULL)
|
if (newHandler == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user