The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / src / node_buffer.h @ 6f92da2d

History | View | Annotate | Download (2.55 KB)

# Date Author Comment
8e29ce9f 07/31/2013 02:12 PM Fedor Indutny

src: lint c++ code

f5e13ae9 06/19/2013 04:15 PM Trevor Norris

buffer: write strings directly from call

Buffer(<String>) used to pass the string to js where it would then be
passed back to cpp for processing. Now only the buffer object
instantiation is done in js and the string is processed in cpp.

Also added a Buffer api that also accepts the encoding.

7373c4dd 06/18/2013 06:41 PM Trevor Norris

buffer: proper API export for Windows

So that Windows users can properly include smalloc and node_buffer,
NODE_EXTERN was added to the headers that export this functionality.

3a2f273b 06/18/2013 06:39 PM Trevor Norris

buffer: use smalloc as backing data store

Memory allocations are now done through smalloc. The Buffer cc class has
been removed completely, but for backwards compatibility have left the
namespace as Buffer.

The .parent attribute is only set if the Buffer is a slice of an...

119354f7 05/14/2013 04:51 PM isaacs

buffer: DRY string encoding using StringBytes

This also templatizes the Buffer::*Slice functions, and the template
function probably cannot be safely used outside of Node. However, it
also SHOULD not be used outside of Node, so this is arguably a feature...

cd42f561 02/01/2013 07:01 PM Ben Noordhuis

buffer: optimize Buffer.prototype.write(s, 'hex')

Move the implementation to C++ land. This is similar to commit 3f65916
but this time for the write() function and the Buffer(s, 'hex')
constructor.

Speeds up the benchmark below about 24x (2.6s vs 1:02m)....

3f65916f 02/01/2013 05:07 PM Ben Noordhuis

buffer: optimize Buffer.prototype.toString('hex')

Move the implementation to C++ land. The old JS implementation used
string concatenation, was dog slow and consumed copious amounts of
memory for large buffers. Example:

var buf = Buffer(0x1000000);  // 16 MB...
22b84e62 01/16/2013 01:17 PM Trevor Norris

buffer: floating point read/write improvements

Improvements:
  • floating point operations are approx 4x's faster
  • Now write quiet NaN's
  • all read/write on floating point now done in C, so no more need for
    lib/buffer_ieee754.js
  • float values have more accurate min/max value checks...
5664dd2f 01/04/2013 06:16 PM Ben Noordhuis

src: use static_cast where appropriate

Use static_cast instead of reinterpret_cast when casting from void*
to another type.

This is mostly an aesthetic change but may help catch bugs when the
affected code is modified.

6c5356bf 12/17/2012 01:47 PM isaacs

Revert "buffer: allocate memory with mmap()"

Also Revert "buffer: use MAP_ANON, fix OS X build"

This reverts commit ddb15603e74e9aa865f3e1099dc2cc5886f9c46e.
This reverts commit 2433ec8276838e90136669d5b1215ba597f15fdd.

2433ec82 12/16/2012 04:19 AM Ben Noordhuis

buffer: allocate memory with mmap()

Work around an issue with the glibc malloc() implementation where memory blocks
are never returned to the operating system when they are allocated with brk()
and have overlapping lifecycles.

Fixes #4283.

7ab4a77d 09/13/2012 10:31 AM Pavel Lang

buffer: update constructor prototype

Change Buffer::New(char*, size_t) to Buffer::New(const char*, size_t).

c8c638a8 09/11/2012 12:33 PM Ben Noordhuis

buffer: change prototype of Data() and Length()

Make Buffer:Data() and Buffer::Length() accept a Value instead of an Object.

b82b4f29 03/30/2012 08:52 AM Ben Noordhuis

buffer: fix signedness compiler warnings

ff4a9d38 03/09/2012 06:14 PM Ben Noordhuis

core: use proper #include directives

8c02f9b7 03/09/2012 05:57 PM Ben Noordhuis

buffer: throw from constructor if length > kMaxLength

Throw, don't abort. `new Buffer(0x3fffffff + 1)` used to bring down the process
with the following error message:

FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData() length
exceeds max acceptable value...
74a8215a 02/06/2012 09:44 AM Ben Noordhuis

Revert support for isolates.

It was decided that the performance benefits that isolates offer (faster spin-up
times for worker processes, faster inter-worker communication, possibly a lower
memory footprint) are not actual bottlenecks for most people and do not outweigh...

59055b22 12/07/2011 07:01 PM Ryan Dahl

Move node_buffer.cc globals to struct

3e696d18 11/16/2011 06:54 PM Bert Belder

Windows: make Buffer and ObjectWrap available to compiled extensions

Closes GH-2036

189dd8f8 11/04/2011 11:24 AM Bert Belder

Fix line endings and trailing whitespace

5fd9adcc 06/14/2011 07:18 AM Ryan Dahl

Remove confusing comment in node_buffer.h

5e1b7cad 05/06/2011 04:39 PM Konstantin Käfer

Add Buffer::fill method to do memset

Fixes #477.

55048cdf 03/14/2011 08:37 PM Ryan Dahl

Update copyright headers

594642b3 03/10/2011 05:06 PM Ben Noordhuis

Buffer::Length(Buffer*) should not invoke itself recursively.

Closes GH-759.

9e101f2b 02/07/2011 04:35 PM Konstantin Käfer

UCS-2 support

Closes GH-644.

468042fc 01/04/2011 08:23 PM Ryan Dahl

Add C++ Buffer migration tips

23204979 11/20/2010 11:55 PM Ryan Dahl

Revert "Merge branch 'writev'"

This reverts commit cd9515efd99dfa6510e72342a2621bb4b291a89c, reversing
changes made to df46c8e698b9400abaabd77ec836c7cdadf9735c.

Too slow. Needs more work.

56074d10 11/20/2010 03:04 AM Ryan Dahl

Inline Buffer::Length and Buffer::Data

3884b418 11/18/2010 07:47 PM Ryan Dahl

Small clean ups

d74c5060 11/18/2010 07:47 PM Ryan Dahl

Support encoding

41c15635 11/01/2010 05:59 PM Ryan Dahl

Remove old buffer api

dcc4fffe 10/26/2010 04:43 PM Ryan Dahl

Add C++ API for constructing fast buffer from string

dd527374 10/22/2010 07:52 PM Stéphan Kochen

Provide a C++ Buffer constructor for external storage.

In order to do this, buffer data management was moved out of the
JS entry-point New, and into Replace.

Secondly, the constructor makes an immediate call to Replace, and
in order for ArrayData calls to work, wrapping must already be set...

d9b08d66 10/22/2010 04:32 PM Stéphan Kochen

Remove old interface remains from Buffer.

These were all lacking implementation, so deprecating wouldn't help.

0cf03ab8 10/10/2010 10:08 PM Ryan Dahl

Add char* constructor for Buffer

b5359e40 10/09/2010 03:15 PM Ryan Dahl

Warnings for new C++ buffer API

5bc4efe8 09/09/2010 02:03 PM Ryan Dahl

Remove blobs, simplify SlowBuffer

Implement SlowBuffer.prototype.slice in js

1cf538a6 09/09/2010 02:03 PM Ryan Dahl

Work to get C++ fast buffers. incomplete

565d862f 09/09/2010 02:03 PM Ryan Dahl

Fix buffer binding

746d487d 09/09/2010 02:03 PM Tim-Smart

FastBuffer implementation. API needs migration

488aff08 08/21/2010 04:24 AM Ryan Dahl

Improve appendix markdown

2c1ca407 07/23/2010 07:36 PM Ryan Dahl

Implement buffer.write for base64

There might be an off-by-one on the returned value.

528015e0 07/23/2010 04:52 PM Ryan Dahl

Implement buffer.toString('base64')

3768aaae 05/24/2010 04:26 PM Ryan Dahl

Create a public Buffer constructor for use in addons.

44ad6a7d 05/20/2010 12:44 PM Ryan Dahl

Make buffer's c++ constructor public

85487c82 04/05/2010 12:37 AM Ryan Dahl

Blob struct should not contain actual data

This is to allow eventual realloc without messing up the data_ references in
all the slices.

b72ffc0e 04/04/2010 09:59 PM Ryan Dahl

Add buffer.copy

ac684f35 03/19/2010 11:33 PM Ryan Dahl

Add legacy 'binary' encoding/decoding methods to Buffer

3a993d88 03/19/2010 03:02 PM Ryan Dahl

Buffer.utf8ByteLength -> Buffer.byteLength

1660db6b 02/02/2010 10:35 PM Ryan Dahl

Inline Buffer::HasInstance

4f56d8ae 02/01/2010 04:10 PM Ryan Dahl

Rename Buffer.utf8Length to Buffer.utf8ByteLength

78553169 01/29/2010 12:57 PM Ryan Dahl

Add buffer.unpack

bf803f47 01/27/2010 06:40 PM Ryan Dahl

Reimplment Buffers

741e3fa9 01/25/2010 08:55 PM Ryan Dahl

HTTP works somewhat on net2 now

However it's not working very well: Hitting a 'hello world' server with many
requests (ab -t 60 -c 10) will cause it to crash with the following error.

Obtained 3 stack frames.
./node(_Z11print_tracev+0x1c) [0x80d1b3c]...
bffa18be 01/24/2010 05:06 PM Ryan Dahl

Expose buffer_root()

469e2648 12/29/2009 03:12 PM Ryan Dahl

More bindings, beginning tcp server code in js

630bb7a0 12/29/2009 03:12 PM Ryan Dahl

Rename blob to buffer.