I’ve been asked to look at cleaning up issues that concern the way the 
native C++ code in one module interacts with the native C++ code in another 
module. 

The module dependency tree is like this:

App -> Module B -> Module A -> node.js

Module A has a standard C++ class with the normal V8 / node.js API bindings 
so that JavaScript code in Module B can call it via the “require('foo')” 
primitive etc. 

My problem is that there is JavaScript code in Module B that calls native 
code in Module A and native code in Module B. All this works fine, but 
there is a very expensive conversion process when data from the native code 
in A has to be supplied to the native code in B.

The crazy thing is that the data that needs to be transferred is actually 
defined in the native code in node.js itself (a BIGNUM in the OpenSSL 
crypto library). So the current process is to get the native code in Module 
A to convert the BIGNUM to a Buffer, this is then passed to the native code 
in Module B which immediately turns it back into a BIGNUM. 

So I started to look at the how I could get the native code in Module B to 
directly interact with the native code in Module A (in just the same as 
both modules interact, for example, with the OpenSSL code in node.js). 

I’m very new to all this, but it would seem that because of the way npm 
builds things. The native code in the two modules end up being compiled 
separately and placed in different “.node” files.

So my questions are:

1, Is there a way for the code in Module B to get at the run-time linkage 
information after Module A has been loaded?
2, If not, what is the recommended way to sort his out. The only thing that 
comes to my mind is to abandon the nice modularity, remove Module A 
altogether, and cut/paste the code directly into Module B, which would be 
rather sad.

Thanks in advance….

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/0e97211c-f1b4-4932-b4b0-ba524ea18783%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to