It is not safe to re-use a buffer once it's passed to an async method, and before the callback. In the case of stream.write() it's not safe to assume that it's *ever* ok to re-use it.
Memory is cheap. If you don't know for sure that it's your bottleneck, just let it go out of scope and get collected. On Tue, Oct 9, 2012 at 7:34 AM, khs4473 <[email protected]> wrote: > At what point is it safe to reuse a buffer that is submitted to fs.write? > Clearly when the callback is executed, but the buffer appears to be free on > nextTick as well... > > Kevin > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
