This is the example: http://pastebin.com/K4D6d4iB

1) The first thing is that "Loop" is not found:

  CXX(target) Release/obj.target/binding/binding.o
../binding.cc: In static member function ‘static v8::Handle<v8::Value> 
HelloWorld::Async(const v8::Arguments&)’:
../binding.cc:62: error: ‘Loop’ was not declared in this scope

This is why I have replaced it with a call to "uv_default_loop" in line 62.

2) Memory leaks: The following example, which is using the binding, should 
not leak memory when running for a long time:

try {
var binding = require('./build/Release/binding')
var o = new binding.HelloWorld
console.log(o.__proto__)
var a;
(a = function (){
o.async(function(){ /*console.log(arguments);*/process.nextTick(a); })
})()
}
catch (e) {
console.log(e)
}

But it does leak memory.

When using an async function without the binding, it will not leak memory:

try {
var binding = require('./build/Release/binding')
var o = new binding.HelloWorld
o.async = function (cb) { cb(null, 1) };
...

What did I miss?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to