<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 9, 2014 at 9:41 PM, Max Lapshin <span dir="ltr"><<a href="mailto:max.lapshin@gmail.com" target="_blank">max.lapshin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Can driver_deq API guarantee that output binary will not be copied?<br></div></div>
</blockquote></div><br></div><div class="gmail_extra">If the binary is an offheap binary (which I guess your binaries are), then it will most likely never be copied. The function outputv, driver_enqv, driver_peekqv and driver_deq are built specifically to do as little copying as is possible. I can see in the code that there are cases when binaries are copied, but I don't know when and why they might be triggered, I don't think they will be for your usecase.</div><div class="gmail_extra"><br></div><div class="gmail_extra">If you have problems figuring out how to use the API, file write in the efile driver is the primary example to look at. Or maybe the test code? <a href="https://github.com/erlang/otp/blob/maint/erts/emulator/test/driver_SUITE_data/queue_drv.c">https://github.com/erlang/otp/blob/maint/erts/emulator/test/driver_SUITE_data/queue_drv.c</a></div></div>