[erlang-questions] ErlDrvTermData and memory obligations

Sverker Eriksson <>
Mon May 18 12:05:13 CEST 2009


Paul Davis wrote:
> After reading about the ErlDrvTermData format I'm a bit confused on
> what the memory liveliness obligations are for my linked in driver.
> Ie, for the ErlDrvTermData types that take a pointer argument
> (ERL_DRV_DOUBLE and ERL_DRV_BUF2BINARY specifically) are there any
> requirements for my program to make sure the pointed-to memory lives
> for some amount of time after a call to driver_send_term()? Or am I
> free to destroy these buffers once that call returns?
>
>   
The data is copied. You can do what you want with the buffers after 
driver_send_term or driver_output_term returns.

/Sverker, Erlang/OTP




More information about the erlang-questions mailing list