Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve appendix markdown

  • Loading branch information...
commit 488aff085b9d7b05593771ad2ef37463fce37f84 1 parent 33e919a
@ry ry authored
View
2  benchmark/buffer_creation.js
@@ -1,6 +1,6 @@
-for (var i = 0; i < 9000000; i++) {
+for (var i = 0; i < 9e7; i++) {

9000000 != 9e7

9000000 == 9e6

@wdacgrs
wdacgrs added a note

I think it is not really matter as long as both the tests are going through the same number of iteration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
b = new Buffer(10);
b[1] = 2
}
View
2  benchmark/string_creation.js
@@ -1,6 +1,6 @@
-for (var i = 0; i < 9000000; i++) {
+for (var i = 0; i < 9e7; i++) {
s = '01234567890';
s[1] = "a";
}
View
33 doc/api.markdown
@@ -3289,41 +3289,40 @@ For the moment, that is all the documentation on addons. Please see
## Appendix - Third Party Modules
There are many third party modules for Node. At the time of writing, August
-2010, the master repository of modules is the wiki page at
-
- http://github.com/ry/node/wiki/modules
+2010, the master repository of modules is
+http://github.com/ry/node/wiki/modules[the wiki page].
This appendix is intended as a SMALL guide to new-comers to help them
quickly find what are considered to be quality modules. It is not intended
to be a complete list. There may be better more complete modules found
elsewhere.
- Package System: NPM http://github.com/isaacs/npm
+- Module Installer: [NPM](http://github.com/isaacs/npm)
- HTML Parsing: HTML5 http://github.com/aredridel/html5
+- HTTP Middleware: [Connect](http://github.com/senchalabs/connect)
- HTTP Middleware: Connect http://github.com/senchalabs/connect
+- Web Framework: [Express](http://github.com/visionmedia/express)
- Web Framework: Express http://github.com/visionmedia/express
+- Web Sockets: [Socket.IO](http://github.com/LearnBoost/Socket.IO-node)
- Web Sockets: Socket.IO http://github.com/LearnBoost/Socket.IO-node
+- HTML Parsing: [HTML5](http://github.com/aredridel/html5)
- mDNS/Zeroconf/Bonjour: mDNS http://github.com/agnat/node_mdns
+- [mDNS/Zeroconf/Bonjour](http://github.com/agnat/node_mdns)
- RabbitMQ, AMQP: http://github.com/ry/node-amqp
+- [RabbitMQ, AMQP](http://github.com/ry/node-amqp)
- MySQL: http://github.com/felixge/node-mysql
+- [mysql](http://github.com/felixge/node-mysql)
- Serialization: http://github.com/pgriess/node-msgpack
+- Serialization: [msgpack](http://github.com/pgriess/node-msgpack)
- Scraping: http://github.com/silentrob/Apricot
+- Scraping: [Apricot](http://github.com/silentrob/Apricot)
- Debugger: ndb http://github.com/smtlaissezfaire/ndb is a CLI debugger
- Node-Inspector http://github.com/dannycoates/node-inspector is a web based
+- Debugger: [ndb](http://github.com/smtlaissezfaire/ndb) is a CLI debugger
+ [inspector](http://github.com/dannycoates/node-inspector) is a web based
tool.
- pcap binding: http://github.com/mranney/node_pcap
+- [pcap binding](http://github.com/mranney/node_pcap)
- ncurses: http://github.com/mscdex/node-ncurses
+- [ncurses](http://github.com/mscdex/node-ncurses)
Patches to this list are welcome.
View
19 src/node_buffer.cc
@@ -701,6 +701,22 @@ Handle<Value> Buffer::ByteLength(const Arguments &args) {
}
+Handle<Value> Buffer::MakeFastBuffer(const Arguments &args) {
+ HandleScope scope;
+
+ Buffer *buffer = ObjectWrap::Unwrap<Buffer>(args[0]->ToObject());
+ Local<Object> fast_buffer = args[1]->ToObject();;

;;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ uint32_t offset = args[2]->Uint32Value();
+ uint32_t length = args[3]->Uint32Value();
+
+ fast_buffer->SetIndexedPropertiesToPixelData((uint8_t*)buffer->data() + offset,
+ length);
+
+ return Undefined();
+}
+
+
+
void Buffer::Initialize(Handle<Object> target) {
HandleScope scope;
@@ -731,6 +747,9 @@ void Buffer::Initialize(Handle<Object> target) {
NODE_SET_METHOD(constructor_template->GetFunction(),
"byteLength",
Buffer::ByteLength);
+ NODE_SET_METHOD(constructor_template->GetFunction(),
+ "makeFastBuffer",
+ Buffer::MakeFastBuffer);
target->Set(String::NewSymbol("Buffer"), constructor_template->GetFunction());
}
View
1  src/node_buffer.h
@@ -61,6 +61,7 @@ class Buffer : public ObjectWrap {
static v8::Handle<v8::Value> AsciiWrite(const v8::Arguments &args);
static v8::Handle<v8::Value> Utf8Write(const v8::Arguments &args);
static v8::Handle<v8::Value> ByteLength(const v8::Arguments &args);
+ static v8::Handle<v8::Value> MakeFastBuffer(const v8::Arguments &args);
static v8::Handle<v8::Value> Unpack(const v8::Arguments &args);
static v8::Handle<v8::Value> Copy(const v8::Arguments &args);
Please sign in to comment.
Something went wrong with that request. Please try again.