1

I was reading code from one of the projects from github. I came across something called a Vectored Referencing buffer implementation. Can have someone come across this ? What are the practical applications of this. I did a quick google search and wasn't able to find any simple sample implementation for this.

Some insight would be helpful.

KodeWarrior
  • 3,538
  • 3
  • 26
  • 40

1 Answers1

2

http://www.ibm.com/developerworks/library/j-zerocopy/

http://www.linuxjournal.com/article/6345

http://www.seccuris.com/documents/whitepapers/20070517-devsummit-zerocopybpf.pdf

https://github.com/joyent/node/pull/304

I think some more insight on your specific project/usage/etc would allow for a more specific answer.

However, the term is generally used to either change or start an interface/function/routine with the goal that it does not allocate another instance of its input in order to perform its operations.

EDIT: Ok, after reading the new title, I think you are simply talking about pushing buffers into a vector of buffers. This keeps your code clean, you can pass any buffer you need with minimal overhead to any function call, and allows for a better cleanup time if your code isn't managed.

EDIT 2: Do you mean this http://cpansearch.perl.org/src/TYPESTER/Data-MessagePack-Stream-0.07/msgpack-0.5.7/src/msgpack/vrefbuffer.h

im so confused
  • 2,091
  • 1
  • 16
  • 25
  • Appreciate your help. I have edited the question to more specific implementation ( Vectored Referencing BUffer ) – KodeWarrior Sep 19 '12 at 21:10
  • Ho ! Ya the same vrefbuffer.h :) Could explain more on the advantages of this type of buffer ? – KodeWarrior Sep 19 '12 at 21:30
  • OK, actually, I THINK that this file, in fact, is attempting to wrap a buffer in the C++ vector style. That is, allow for easy appending, etc. Obviously you can see the huge advantage of the convenience all the "vector" operations written there would convey over a regular unsigned char *. That, I believe, is the goal of this file. – im so confused Sep 19 '12 at 22:39