[erlang-questions] Is is safe?

Zabrane Mickael <>
Sat Mar 9 22:12:33 CET 2013


Hi guys,

Is is safe to call driver_realloc (http://www.erlang.org/doc/man/erl_driver.html#driver_realloc) with a null pointer:

ErlDrvBinary *ptr = NULL;
[...]
ptr = driver_realloc(ptr, len);
assert(ptr);

The doc says it's simply a wrapper around "realloc" and my code seems to work well.
The first call is simply a call to "malloc" as the pointer is null, right?

Can you confirm (OTP) guys?

Regards,
Zabrane



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130309/1727726e/attachment.html>


More information about the erlang-questions mailing list