Added Interoperability with native memory frameworks

Hi Piotr,

Here are the changes,
Tried to match your java style, but failed..
maybe you should reformat the code to your liking :-)

Let me know whet you think...

-Loic