Skip to content

Instantly share code, notes, and snippets.

var log = console.log
, Kombo = require( '../' )
, test = function ( mbytes ) {
var mb = Math.max( mbytes, 1 )
, b = new Buffer( mb * 1024 * 1024 )
, stime = -1
, etime= -1
, i = 0
;
@rootslab
rootslab / gist:1237478
Created September 23, 2011 14:26
(NodeJs) Buffer Size bug
// https://github.com/joyent/node/blob/master/lib/buffer.js R#~208
...
// Are we slicing?
if (typeof offset === 'number') {
this.length = Math.floor( encoding ); // <-- probably also here
this.parent = subject;
this.offset = offset;
} else {
// Find the length
switch (type = typeof subject) {