You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An expression like ~() will call malloc(0) and abort if it returns a null pointer. This may also a waste of memory on implementations where it does return a non-null pointer like glibc.
The text was updated successfully, but these errors were encountered:
The `malloc` family of functions may return a null pointer for a
zero-size allocation, which should not be interpreted as an
out-of-memory error.
If the implementation does not return a null pointer, then handling
this will result in memory savings for zero-size types.
This also switches some code to `malloc_raw` in order to maintain a
centralized point for handling out-of-memory in `rt::global_heap`.
Closes#11634
The `malloc` family of functions may return a null pointer for a
zero-size allocation, which should not be interpreted as an
out-of-memory error.
If the implementation does not return a null pointer, then handling
this will result in memory savings for zero-size types.
This also switches some code to `malloc_raw` in order to maintain a
centralized point for handling out-of-memory in `rt::global_heap`.
Closes#11634
An expression like
~()
will callmalloc(0)
andabort
if it returns a null pointer. This may also a waste of memory on implementations where it does return a non-null pointer like glibc.The text was updated successfully, but these errors were encountered: