[patch] add a 'dont_pack_binaries' option to open_port/2 to disable packing small binaries in port_command/2

Raimo Niskanen raimo@REDACTED
Fri May 12 09:11:38 CEST 2006


I think your suggestion is an excellent idea. Unfortunately it will not
make it into the R11B first release, but probably the next.
Thank you for the patch!

 
> Packing is normally triggered when more than 16 binaries are 
> passed in the io-list. In that case, contiguous "small enough" 
> binaries are copied together into single buffers.
> With this patch, when this option is set, packing is never 
> triggered, ensuring that all binaries are passed by reference 
> and are never copied.
> 
> Preventing packing is necessary when the boundaries between 
> binaries must be preserved.
> 
> This patch is against the otp_src_R10B_2006-02-27 snapshot.
> 
> I have no patch for the documentation, but I suggest adding this 
> comment into the documentation about open_port/2, in 
> the 'erlang' module documentation:
> 
> dont_pack_binaries
>   Prevents packing (copying/grouping of small binaries in 
> io-lists into larger buffers) in calls to port_command/2.
> 
> 
> Regards,
> 
> -- 
> Romain LENGLET
> 

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list