summaryrefslogtreecommitdiff
path: root/src/node_buffer.h
Commit message (Collapse)AuthorAgeFilesLines
* buffer: optimize Buffer.prototype.write(s, 'hex')Ben Noordhuis2013-02-021-0/+1
| | | | | | | | | | | | 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). var s = 'f'; for (var i = 0; i < 26; ++i) s += s; // 64 MB Buffer(s, 'hex');
* buffer: optimize Buffer.prototype.toString('hex')Ben Noordhuis2013-02-011-0/+1
| | | | | | | | | | | | | 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 buf.toString('hex') // Used 3+ GB of memory. The new implementation operates in O(n) time and space. Fixes #4700.
* buffer: floating point read/write improvementsTrevor Norris2013-01-161-0/+8
| | | | | | | | | | | | | | | 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 * add additional benchmarks for buffers read/write * created benchmark/_bench_timer.js which is a simple library that can be included into any benchmark and provides an intelligent tracker for sync and async tests * add benchmarks for DataView set methods * add checks and tests to make sure offset is greater than 0
* src: use static_cast where appropriateBen Noordhuis2013-01-051-1/+1
| | | | | | | | 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.
* Revert "buffer: allocate memory with mmap()"isaacs2012-12-171-3/+0
| | | | | | | Also Revert "buffer: use MAP_ANON, fix OS X build" This reverts commit ddb15603e74e9aa865f3e1099dc2cc5886f9c46e. This reverts commit 2433ec8276838e90136669d5b1215ba597f15fdd.
* buffer: allocate memory with mmap()Ben Noordhuis2012-12-161-0/+3
| | | | | | | | 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.
* buffer: update constructor prototypePavel Lang2012-09-131-3/+7
| | | | Change Buffer::New(char*, size_t) to Buffer::New(const char*, size_t).
* buffer: change prototype of Data() and Length()Ben Noordhuis2012-09-111-4/+9
| | | | Make Buffer:Data() and Buffer::Length() accept a Value instead of an Object.
* buffer: fix signedness compiler warningsBen Noordhuis2012-03-301-1/+1
|
* core: use proper #include directivesBen Noordhuis2012-03-101-3/+3
|
* buffer: throw from constructor if length > kMaxLengthBen Noordhuis2012-03-091-0/+3
| | | | | | | | | | 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 Fixes #2280.
* Revert support for isolates.Ben Noordhuis2012-02-061-0/+1
| | | | | | | | | | | | 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 the potential stability issues and intrusive changes to the code base that first-class support for isolates requires. Hence, this commit backs out all isolates-related changes. Good bye, isolates. We hardly knew ye.
* Move node_buffer.cc globals to structRyan Dahl2011-12-071-2/+0
|
* Windows: make Buffer and ObjectWrap available to compiled extensionsBert Belder2011-11-171-1/+1
| | | | Closes GH-2036
* Fix line endings and trailing whitespaceBert Belder2011-11-041-1/+1
|
* Remove confusing comment in node_buffer.hRyan Dahl2011-06-141-3/+0
|
* Add Buffer::fill method to do memsetKonstantin Käfer2011-05-061-0/+1
| | | | Fixes #477.
* Update copyright headersRyan Dahl2011-03-141-0/+21
|
* Buffer::Length(Buffer*) should not invoke itself recursively.Ben Noordhuis2011-03-101-1/+1
| | | | Closes GH-759.
* UCS-2 supportKonstantin Käfer2011-02-071-0/+2
| | | | Closes GH-644.
* Add C++ Buffer migration tipsRyan Dahl2011-01-041-9/+47
|
* Revert "Merge branch 'writev'"Ryan Dahl2010-11-201-3/+1
| | | | | | | This reverts commit cd9515efd99dfa6510e72342a2621bb4b291a89c, reversing changes made to df46c8e698b9400abaabd77ec836c7cdadf9735c. Too slow. Needs more work.
* Inline Buffer::Length and Buffer::DataRyan Dahl2010-11-201-2/+7
|
* Small clean upsRyan Dahl2010-11-181-1/+1
|
* Support encodingRyan Dahl2010-11-181-1/+3
|
* Remove old buffer apiRyan Dahl2010-11-011-11/+1
|
* Add C++ API for constructing fast buffer from stringRyan Dahl2010-10-261-0/+3
|
* Provide a C++ Buffer constructor for external storage.Stéphan Kochen2010-10-221-1/+8
| | | | | | | | | 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 up. Now, the constructor takes the wrappee as a parameter.
* Remove old interface remains from Buffer.Stéphan Kochen2010-10-221-21/+2
| | | | These were all lacking implementation, so deprecating wouldn't help.
* Add char* constructor for BufferRyan Dahl2010-10-101-0/+1
|
* Warnings for new C++ buffer APIRyan Dahl2010-10-091-2/+11
|
* Remove blobs, simplify SlowBufferRyan Dahl2010-09-091-4/+3
| | | | Implement SlowBuffer.prototype.slice in js
* Work to get C++ fast buffers. incompleteRyan Dahl2010-09-091-5/+4
|
* Fix buffer bindingRyan Dahl2010-09-091-1/+0
|
* FastBuffer implementation. API needs migrationTim-Smart2010-09-091-0/+1
|
* Improve appendix markdownRyan Dahl2010-08-211-0/+1
|
* Implement buffer.write for base64Ryan Dahl2010-07-231-0/+1
| | | | There might be an off-by-one on the returned value.
* Implement buffer.toString('base64')Ryan Dahl2010-07-231-0/+1
|
* Create a public Buffer constructor for use in addons.Ryan Dahl2010-05-241-8/+9
|
* Make buffer's c++ constructor publicRyan Dahl2010-05-201-5/+6
|
* Blob struct should not contain actual dataRyan Dahl2010-04-041-3/+3
| | | | | This is to allow eventual realloc without messing up the data_ references in all the slices.
* Add buffer.copyRyan Dahl2010-04-041-0/+1
|
* Add legacy 'binary' encoding/decoding methods to BufferRyan Dahl2010-03-191-0/+2
|
* Buffer.utf8ByteLength -> Buffer.byteLengthRyan Dahl2010-03-191-1/+1
|
* Inline Buffer::HasInstanceRyan Dahl2010-02-021-1/+5
|
* Rename Buffer.utf8Length to Buffer.utf8ByteLengthRyan Dahl2010-02-011-1/+1
|
* Add buffer.unpackRyan Dahl2010-01-291-0/+1
|
* Reimplment BuffersRyan Dahl2010-01-271-33/+35
|
* HTTP works somewhat on net2 nowRyan Dahl2010-01-251-1/+4
| | | | | | | | | | | | | | | | 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] ./node(_ZN4node6Parser7ExecuteERKN2v89ArgumentsE+0x69) [0x80d3759] ./node [0x811f44b] TypeError: Already parsing a buffer at Socket.<anonymous> (/home/ryan/projects/node/lib/http2.js:393:20) at IOWatcher.callback (/home/ryan/projects/node/lib/net.js:81:12) at node.js:985:9 at node.js:989:1
* Expose buffer_root()Ryan Dahl2010-01-241-2/+6
|