c-server memory management
Peter H|gfeldt
peter@REDACTED
Mon Jun 17 11:32:55 CEST 2002
On 16 Jun 2002, Paul R. Bernard wrote:
> I'm playing with a simple c-server using ic:gen(test.idl,
> [{be,c_server}]). Most of the parameters are simple types long, short
> and so on. In a couple cases however it seems a good idea to use the
> builtin erlang:binary type for some of the data I'd like to pass
> around.
>
> The generated function *__dec that deals with the functions that
> handle the erlang:binary types are 'malloc'ing storage for them. As
> far as I can see this storage is not being freed so I'm assuming that
> it's my responsibility to free this memory and I should be doing so in
> the appropriate *__rs function. Correct?
Right. Since `binary' is typedef'ed as a `sequence' (see `erlang.idl') you
have to.
[...]
> Thanks,
>
> - paul
>
/Peter
More information about the erlang-questions
mailing list