Skip to content

Commit 488aff0

Browse files
committed
Improve appendix markdown
1 parent 33e919a commit 488aff0

5 files changed

Lines changed: 38 additions & 19 deletions

File tree

benchmark/buffer_creation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
for (var i = 0; i < 9000000; i++) {
3+
for (var i = 0; i < 9e7; i++) {
44
b = new Buffer(10);
55
b[1] = 2
66
}

benchmark/string_creation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
for (var i = 0; i < 9000000; i++) {
3+
for (var i = 0; i < 9e7; i++) {
44
s = '01234567890';
55
s[1] = "a";
66
}

doc/api.markdown

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,41 +3289,40 @@ For the moment, that is all the documentation on addons. Please see
32893289
## Appendix - Third Party Modules
32903290

32913291
There are many third party modules for Node. At the time of writing, August
3292-
2010, the master repository of modules is the wiki page at
3293-
3294-
http://github.com/ry/node/wiki/modules
3292+
2010, the master repository of modules is
3293+
http://github.com/ry/node/wiki/modules[the wiki page].
32953294

32963295
This appendix is intended as a SMALL guide to new-comers to help them
32973296
quickly find what are considered to be quality modules. It is not intended
32983297
to be a complete list. There may be better more complete modules found
32993298
elsewhere.
33003299

3301-
Package System: NPM http://github.com/isaacs/npm
3300+
- Module Installer: [NPM](http://github.com/isaacs/npm)
33023301

3303-
HTML Parsing: HTML5 http://github.com/aredridel/html5
3302+
- HTTP Middleware: [Connect](http://github.com/senchalabs/connect)
33043303

3305-
HTTP Middleware: Connect http://github.com/senchalabs/connect
3304+
- Web Framework: [Express](http://github.com/visionmedia/express)
33063305

3307-
Web Framework: Express http://github.com/visionmedia/express
3306+
- Web Sockets: [Socket.IO](http://github.com/LearnBoost/Socket.IO-node)
33083307

3309-
Web Sockets: Socket.IO http://github.com/LearnBoost/Socket.IO-node
3308+
- HTML Parsing: [HTML5](http://github.com/aredridel/html5)
33103309

3311-
mDNS/Zeroconf/Bonjour: mDNS http://github.com/agnat/node_mdns
3310+
- [mDNS/Zeroconf/Bonjour](http://github.com/agnat/node_mdns)
33123311

3313-
RabbitMQ, AMQP: http://github.com/ry/node-amqp
3312+
- [RabbitMQ, AMQP](http://github.com/ry/node-amqp)
33143313

3315-
MySQL: http://github.com/felixge/node-mysql
3314+
- [mysql](http://github.com/felixge/node-mysql)
33163315

3317-
Serialization: http://github.com/pgriess/node-msgpack
3316+
- Serialization: [msgpack](http://github.com/pgriess/node-msgpack)
33183317

3319-
Scraping: http://github.com/silentrob/Apricot
3318+
- Scraping: [Apricot](http://github.com/silentrob/Apricot)
33203319

3321-
Debugger: ndb http://github.com/smtlaissezfaire/ndb is a CLI debugger
3322-
Node-Inspector http://github.com/dannycoates/node-inspector is a web based
3320+
- Debugger: [ndb](http://github.com/smtlaissezfaire/ndb) is a CLI debugger
3321+
[inspector](http://github.com/dannycoates/node-inspector) is a web based
33233322
tool.
33243323

3325-
pcap binding: http://github.com/mranney/node_pcap
3324+
- [pcap binding](http://github.com/mranney/node_pcap)
33263325

3327-
ncurses: http://github.com/mscdex/node-ncurses
3326+
- [ncurses](http://github.com/mscdex/node-ncurses)
33283327

33293328
Patches to this list are welcome.

src/node_buffer.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,22 @@ Handle<Value> Buffer::ByteLength(const Arguments &args) {
701701
}
702702

703703

704+
Handle<Value> Buffer::MakeFastBuffer(const Arguments &args) {
705+
HandleScope scope;
706+
707+
Buffer *buffer = ObjectWrap::Unwrap<Buffer>(args[0]->ToObject());
708+
Local<Object> fast_buffer = args[1]->ToObject();;
709+
uint32_t offset = args[2]->Uint32Value();
710+
uint32_t length = args[3]->Uint32Value();
711+
712+
fast_buffer->SetIndexedPropertiesToPixelData((uint8_t*)buffer->data() + offset,
713+
length);
714+
715+
return Undefined();
716+
}
717+
718+
719+
704720
void Buffer::Initialize(Handle<Object> target) {
705721
HandleScope scope;
706722

@@ -731,6 +747,9 @@ void Buffer::Initialize(Handle<Object> target) {
731747
NODE_SET_METHOD(constructor_template->GetFunction(),
732748
"byteLength",
733749
Buffer::ByteLength);
750+
NODE_SET_METHOD(constructor_template->GetFunction(),
751+
"makeFastBuffer",
752+
Buffer::MakeFastBuffer);
734753

735754
target->Set(String::NewSymbol("Buffer"), constructor_template->GetFunction());
736755
}

src/node_buffer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class Buffer : public ObjectWrap {
6161
static v8::Handle<v8::Value> AsciiWrite(const v8::Arguments &args);
6262
static v8::Handle<v8::Value> Utf8Write(const v8::Arguments &args);
6363
static v8::Handle<v8::Value> ByteLength(const v8::Arguments &args);
64+
static v8::Handle<v8::Value> MakeFastBuffer(const v8::Arguments &args);
6465
static v8::Handle<v8::Value> Unpack(const v8::Arguments &args);
6566
static v8::Handle<v8::Value> Copy(const v8::Arguments &args);
6667

0 commit comments

Comments
 (0)