Skip to content

Instantly share code, notes, and snippets.

Avatar

Timothy J Fontaine tjfontaine

View GitHub Profile
View idiot.patch
diff --git a/src/node.h b/src/node.h
index 7a08dc9..5dbf28f 100644
--- a/src/node.h
+++ b/src/node.h
@@ -122,6 +122,17 @@ NODE_EXTERN v8::Handle<v8::Value> MakeCallback(
# endif
#endif
+#ifdef _WIN32
+// TODO(tjfontaine) consider changing the usage of ssize_t to ptrdiff_t
View gist:8715862
--harmony_typeof (enable harmony semantics for typeof)
--harmony_scoping (enable harmony block scoping)
--harmony_modules (enable harmony modules (implies block scoping))
--harmony_symbols (enable harmony symbols (a.k.a. private names))
--harmony_proxies (enable harmony proxies)
--harmony_collections (enable harmony collections (sets, maps, and weak maps))
--harmony_observation (enable harmony object observation (implies harmony collections)
--harmony_generators (enable harmony generators)
--harmony_iteration (enable harmony iteration (for-of))
--harmony_numeric_literals (enable harmony numeric literals (0o77, 0b11))
View double-error.js
var util = require('util');
var assert = require('assert');
var net = require('net');
var SIZE = 2E6;
var BUF = new Buffer(SIZE);
var ERRS = 0;
var PORT = 4000;
BUF.fill(0x62);
View trace.js
var restify = tracing.createProvider('restify'); // { namespace: 'anonymous', provider: 'restify', guid: stablehash }
var restify = tracing.createProvider({
namespace: 'joyent',
provider: 'restify',
guid: '12345',
});
restify.addProbe('foo', ['string', 'number', 'integer']);
restify.enable();
View al.patch
From 74a81f7588f86b66e277ea70724d17b583efc7d4 Mon Sep 17 00:00:00 2001
From: Timothy J Fontaine <tjfontaine@gmail.com>
Date: Sun, 19 Jan 2014 11:41:25 -0800
Subject: [PATCH] asyncListener: adapt to tracing interface
---
lib/tracing.js | 174 +++++++++++++++++++++++++++++++++++++++++++++++
src/async-wrap-inl.h | 92 +++++++++++++++++++++----
src/async-wrap.h | 77 +++++++++++++++++++--
src/cares_wrap.cc | 24 +++++--
View t.js
// --max-old-space-size=4095
var bigdata = [],
iterations = 0;
function addData() {
iterations++;
if (iterations % 10 == 0)
console.log(iterations, bigdata.length, process.memoryUsage());
for (var i = 0; i < 1e5; i++) {
View gist:9010639
thread apply all bt
Thread 6 (process 83744):
#0 0x00007fff88071a56 in semaphore_wait_trap ()
#1 0x000000010034d2b7 in v8::internal::Semaphore::Wait (this=0x101014a48) at semaphore.h:69
#2 0x00000001003c1b7b in v8::internal::Acquire_Load () at ../deps/v8/src/sweeper-thread.cc:64
#3 v8::internal::Acquire_Load () at /Users/tjfontaine/Development/node/deps/v8/src/atomicops_internals_x86_macosx.h:288
#4 0x00000001003c1b7b in v8::internal::SweeperThread::Run (this=0x101014a00) at ../deps/v8/src/sweeper-thread.cc:66
#5 0x000000010045b20a in v8::internal::Thread::NotifyStartedAndRun () at /Users/tjfontaine/Development/node/deps/v8/src/platform.h:584
#6 0x000000010045b20a in v8::internal::ThreadEntry (arg=0x101014a00) at platform.h:611
View api.ii
# 1 "/usr/include/sys/ucontext.h" 1 3 4
# 36 "/usr/include/sys/ucontext.h" 3 4
# 1 "/usr/include/sys/regset.h" 1 3 4
# 39 "/usr/include/sys/regset.h" 3 4
extern "C" {
# 158 "/usr/include/sys/regset.h" 3 4
typedef int greg_t;
# 168 "/usr/include/sys/regset.h" 3 4
typedef greg_t gregset_t[19];
# 189 "/usr/include/sys/regset.h" 3 4
View gist:9240569
* thread #1: tid = 0x3dbfe, 0x000000010014a076 node`uv__signal_handler [inlined] uv__signal_tree_s_RB_NEXT(elm=<unavailable>) + 24 at signal.c:52, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x79)
frame #0: 0x000000010014a076 node`uv__signal_handler [inlined] uv__signal_tree_s_RB_NEXT(elm=<unavailable>) + 24 at signal.c:52
frame #1: 0x000000010014a05e node`uv__signal_handler(signum=20) + 167 at signal.c:151
frame #2: 0x00007fff98f095aa libsystem_platform.dylib`_sigtramp + 26
frame #3: 0x00007fff93c2264b libsystem_kernel.dylib`kevent + 11
frame #4: 0x000000010014932e node`uv__chld(handle=<unavailable>, signum=<unavailable>) + 330 at process.c:116
frame #5: 0x0000000100144909 node`uv_run(loop=0x0000000100e00950, mode=UV_RUN_DEFAULT) + 271 at core.c:285
frame #6: 0x000000010002b2a1 node`node::SyncProcessRunner::TryInitializeAndRunLoop(this=0x00007fff5fbfefe0, options=<unavailable>) + 261 at spawn_sync.cc:495
frame #7: 0x000000010002af0a node`node:
View _stream_readable.diff
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
index e1636c8..e65efd7 100644
--- a/lib/_stream_readable.js
+++ b/lib/_stream_readable.js
@@ -544,7 +544,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) {
// however, don't suppress the throwing behavior for this.
function onerror(er) {
debug('onerror', er);
- unpipe();
+ unpipe(er);