The use of mem::forget is extremely dangerous, as it gives no guarantee that the forgotten memory won't be clobbered. This PR fixes this making explicit use of the global allocator via the alloc and dealloc functions.
The one downside is that we explicitly copy returns from the module on every function call.
The use of
mem::forget
is extremely dangerous, as it gives no guarantee that the forgotten memory won't be clobbered. This PR fixes this making explicit use of the global allocator via thealloc
anddealloc
functions.The one downside is that we explicitly copy returns from the module on every function call.
Resolves: #105