I was trying to use this for backing a d3.js graph, and after a bit of debugging found that (to me) it looks like the semantics of .length and .size are the wrong way around. That is to say, for a "plain" JS Array, .length is (usually, except for some edge cases) the number of elements in the array, what is CBuffer.size here.
For using CBuffer as a "drop-in" replacement for a plain old Array, exchanging these meanings might be helpful. What do you think?
I was trying to use this for backing a d3.js graph, and after a bit of debugging found that (to me) it looks like the semantics of
.lengthand.sizeare the wrong way around. That is to say, for a "plain" JSArray,.lengthis (usually, except for some edge cases) the number of elements in the array, what isCBuffer.sizehere.For using
CBufferas a "drop-in" replacement for a plain oldArray, exchanging these meanings might be helpful. What do you think?