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
Now that C.malloc is really C.__Cmalloc where __Cmalloc is our wrapper, we should make
the wrapper change 0 to 1 before calling the standard malloc. The standard malloc(0) can
return NULL, which will make the wrapper crash the program.
Thanks to Ralph Corderoy for the reminder.
(See issue #3403.)
The text was updated successfully, but these errors were encountered:
Perhaps only malloc(1) if malloc(0) returns NULL in case there's special handling of 0
that returns non-NULL and is less overhead, e.g. descriptor only.
if(p == NULL && (n || (p = malloc(1)) == NULL))
runtime_throw("runtime: C malloc failed");
The text was updated successfully, but these errors were encountered: