/**
* Ordered fastest to slowest.
* Different ways to extract data from a Buffer in C++.
*/
void RunMe(const FunctionCallbackInfo<Value>& args) {
/*
Local<Object> buf = args[0].As<Object>();
char* data = static_cast(buf->GetIndexedPropertiesExternalArrayData());
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <v8.h> | |
#include <node.h> | |
#include <node_buffer.h> | |
#include <string.h> | |
using v8::FunctionCallbackInfo; | |
using v8::Handle; | |
using v8::Isolate; | |
using v8::Local; | |
using v8::Object; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TCP = process.binding('tcp_wrap').TCP; | |
var SlowBuffer = require('buffer').SlowBuffer; | |
var util = require('util'); | |
var err; | |
var headers = 'HTTP/1.1 200 OK\r\n' + | |
'Connection: Keep-Alive\r\n' + | |
'Content-Type: text/plain; charset=latin-1\r\n' + | |
'Content-Length: 12\r\n\r\n' + | |
'hello world\n'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/deps/v8/src/codegen.cc b/deps/v8/src/codegen.cc | |
index 6b12d64..a24220d 100644 | |
--- a/deps/v8/src/codegen.cc | |
+++ b/deps/v8/src/codegen.cc | |
@@ -190,7 +190,7 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { | |
function->end_position() - function->start_position() + 1; | |
for (int i = 0; i < source_len; i++) { | |
if (stream.HasMore()) { | |
- os << AsUC16(stream.GetNext()); | |
+ os << AsReversiblyEscapedUC16(stream.GetNext()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Distance is in 100nm segments. Will be rounding values in order to keep them | |
// in integer space. Hopefully no values exceed +/-2^53. | |
var D = 1e7; | |
var G = 9.80665 * D; | |
// Amount of time to calculate for. | |
var T = 10; | |
// Number of segments to divide time (60 fps). | |
var S = 60 * T; | |
// Initial velocity in m/sec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/domain.js b/lib/domain.js | |
index afaa922..39e90f4 100644 | |
--- a/lib/domain.js | |
+++ b/lib/domain.js | |
@@ -33,7 +33,11 @@ var endMethods = ['end', 'abort', 'destroy', 'destroySoon']; | |
events.usingDomains = true; | |
// let the process know we're using domains | |
-process._usingDomains(); | |
+// The return value let's us know whether --abort-on-uncaught-exception was |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dgram = require('dgram'); | |
var fork = require('child_process').fork; | |
var PORT = 7845; | |
var ITER = 1e4; | |
var MS = 100; | |
var SHUTDOWN = 1000 * 60; | |
var cntr = 0; | |
if (process.argv[2] === 'child') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async_wrap = process.binding('async_wrap'); | |
var b = {}; | |
function initHook() { | |
this._asyncQueue = {}; | |
} | |
function preHook() { | |
throw new Error('preHook'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/haywire/http_server.c b/src/haywire/http_server.c | |
index 6f18b9b..3591aca 100644 | |
--- a/src/haywire/http_server.c | |
+++ b/src/haywire/http_server.c | |
@@ -78,6 +78,7 @@ void free_http_connection(http_connection* connection) | |
free_http_request(connection->request); | |
} | |
+ free(connection->thread); | |
free(connection); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compiled with | |
* clang -pthread -fno-omit-frame-pointer -Wall -g -fstrict-aliasing -O3 \ | |
* -o sem-bounce sem-bounce.c libuv.a -Iuv/include | |
*/ | |
#include "uv.h" | |
#define ITER 1e6 | |
static uv_thread_t thread; |
OlderNewer