On Thu, Nov 21, 2013 at 4:11 PM, Aaron Boxer <[email protected]> wrote: > > On Thu, Nov 21, 2013 at 3:48 AM, Ben Noordhuis <[email protected]> wrote: >> >> On Thu, Nov 21, 2013 at 6:11 AM, Aaron Boxer <[email protected]> wrote: >> > >> >> > is it possible to use a fixed buffer for reads, instead of alloc >> >> > being >> >> > called for each read? >> >> > >> >> > So, say I specify a 65532 byte buffer, can I tell libuv to use this >> >> > buffer >> >> > repeatedly, and if there is more data than can fit, to just call the >> >> > callback again? >> >> >> >> >> >> That works on Unices (though it's best considered an implementation >> >> detail) and will usually work on Windows. uv-win uses native >> >> completion-based I/O, which means it's possible for allocation >> >> lifetimes to overlap. >> > >> > >> > Ben, I just wanted to clarify this a bit more. Currently, I have a >> > single >> > buffer >> > for each client connection, and all reads for that connection use this >> > buffer. >> > Is this safe on windows? >> >> Bert is most qualified to comment on that but I believe the short >> answer is "no, it's not." >> > alright, I will look into the slab allocator. Do you have a link to source > code for this?
https://raw.github.com/joyent/node/v0.10/src/slab_allocator.cc As you can see, it's really quite basic. -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/groups/opt_out.
