Fixed a crash with GCC libs caused by calling FreeHGlobal on non-AllocHGlobal memory.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
Wrapped void* as IntPtr because unlike int*, char*, etc., void* is just ugly and not useful.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
Merge pull request #347 from ddobrev/master

Fixed a memory problem in generated code. Mapped void* to IntPtr