Subject:
[ruby-ffi] MemoryPointer help
From:
Shawn Anderson
Date:
12/14/09 12:42 PM
To:
ruby-ffi@googlegroups.com

I have a struct that has a void* data, I use MemoryPointer to alloc some mem and assign:
mem = FFI::MemoryPointer.new(:long)
@struct.data = mem

Struct says around in my app, but I was seeing strange GC behavior.  Is assigning the mem pointer to the struct good enough to keep it around?
I was seeing my struct.data being corrupted over time.

adding
@mem = mem

fixed the problem.  Am I using MemoryPointer correctly?

/Shawn