<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi guys,</div><div><br></div><div>Is is safe to call driver_realloc (<a href="http://www.erlang.org/doc/man/erl_driver.html#driver_realloc">http://www.erlang.org/doc/man/erl_driver.html#driver_realloc</a>) with a null pointer:</div><div><br></div><div>ErlDrvBinary *ptr = NULL;</div><div>[...]</div>ptr = driver_realloc(ptr, len);<div>assert(ptr);</div><div><br></div><div>The doc says it's simply a wrapper around "realloc" and my code seems to work well.</div><div>The first call is simply a call to "malloc" as the pointer is null, right?</div><div><br></div><div>Can you confirm (OTP) guys?</div><div><br></div><div><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Regards,</div><div>Zabrane</div><div><br></div></div></div><br class="Apple-interchange-newline">
</div>
<br></div></body></html>