joyent/node — Issue #2201: Out of memory error when loading custom c++ module
Author: shtylman
Created: 2011-11-27 01:19:53+00:00
State: open

Details: https://gist.github.com/1396695

When trying to build the dummy.cpp file found in this gist and giving it the module name 'Adummy' for NODE_MODULE(...) I get an Out of Memory error when running "node test.js"

However, when I change the module name to 'dummy' it seems to work fine (doesn't crash).

I have attached the wscript file I used to build the code as well as the test.js file to run it.

I have also provided the nm output for both versions (not sure if it will help).

If I don't use NODE_MODULE and just do a regular extern "C" for the init method it also does not crash. Is NODE_MODULE still the desired thing to use for custom c++ modules? Or can I just use extern "C"? The docs still list NODE_MODULE so I went with that for now.