[erlang-questions] Replace ERL_BIN_ATOM with binary/list in a C node.

pablo platt pablo.platt@REDACTED
Tue Jul 15 17:53:59 CEST 2014


Hi,

I'm using erlycairo to draw on a 2D canvas.
There are several functions that leak atoms:
erlycairo_server:write_to_png/2
erlycairo_server:show_text/2
erlycairo_server:text_extents/2
erlycairo_server:surface_create_from_png/2

I tried to pass a binary to the C node and use (char *)ERL_BIN_PTR(file)
but I'm getting another char at the end of the binary.
https://code.google.com/p/erlycairo/source/browse/trunk/src/erlycairo/erlycairo_server.erl#143
https://code.google.com/p/erlycairo/source/browse/trunk/c_src/erlycairo.c#337

What is the correct way to use binaries or lists instead of atoms for the
write_to_png function?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140715/243e1187/attachment.htm>


More information about the erlang-questions mailing list