Skip to content

Commit

Permalink
genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
lloyd committed Feb 6, 2012
0 parents commit f8c0234
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
/build
/node_modules
*~

18 changes: 18 additions & 0 deletions Makefile
@@ -0,0 +1,18 @@
TESTS = test/*.js

all: build

build: clean configure compile

configure:
node-waf configure

compile:
node-waf build

clean:
#rm -f bcrypt_lib.node
rm -Rf build


.PHONY: clean test build
1 change: 1 addition & 0 deletions include.js
@@ -0,0 +1 @@
module.exports = require('./build/Release/gcstats');
20 changes: 20 additions & 0 deletions package.json
@@ -0,0 +1,20 @@
{
"name": "gcstats",
"description": "Get some data about how V8's GC is behaving within your node program .",
"version": "0.0.1",
"author": "Lloyd Hilaiel (http://lloyd.io)",
"engines": { "node": ">= 0.6.0" },
"repository": {
"type": "git",
"url": "https://github.com/lloydncb000gt/gcstats.git"
},
"licenses": [ { "type": "wtfpl" } ],
"bugs": {
"url" : "https://github.com/lloyd/gcstats/issues"
},
"scripts": {
"install": "make build"
},
"contributors": [
]
}
23 changes: 23 additions & 0 deletions src/gcstats.cc
@@ -0,0 +1,23 @@
/*
* 2012 - lloyd - do what the fuck you want to
*/


#include <node.h>
#include <node_version.h>

#include <string>
#include <cstring>

using namespace v8;
using namespace node;

Handle<Value> meh(const Arguments& args) {
HandleScope scope;
return Integer::New(7);
}

extern "C" void init(Handle<Object> target) {
HandleScope scope;
NODE_SET_METHOD(target, "meh", meh);
};
31 changes: 31 additions & 0 deletions wscript
@@ -0,0 +1,31 @@
# -*- mode: python -*-

import Options, Utils, sys

srcdir = "."
blddir = "build"
VERSION = "0.0.1"

def set_options(opt):
opt.tool_options("compiler_cxx")
opt.tool_options("compiler_cc")

def configure(conf):
conf.check_tool("compiler_cxx")
conf.check_tool("compiler_cc")
conf.check_tool("node_addon")
o = Options.options

libpath = ['/lib', '/usr/lib', '/usr/local/lib', '/opt/local/lib', '/usr/sfw/lib']
includes = ['/usr/include', '/usr/includes', '/usr/local/includes', '/opt/local/includes', '/usr/sfw/lib'];

def build(bld):
gcstats = bld.new_task_gen("cxx", "shlib", "node_addon")
gcstats.cxxflags = [ "-O3" ]
gcstats.target = "gcstats"
gcstats.source = """
src/gcstats.cc
"""

def test(t):
Utils.exec_command('make test')

0 comments on commit f8c0234

Please sign in to comment.