Win32OLE again

S

Steve Tuckner

I am having trouble trying to figure out what is wrong with the Win32ole
extension when running on 1.8.0. I have narrowed it down to the calling
of

ALLOC_N and freeing what is returned from there.

If I just call malloc and free that pointer, that works OK.

I looked at some other ruby extensions and they don't call ALLOC_N.

I looked at the ruby source and it seems that ALLOC_N is just a call to
ruby_malloc which in turn calls malloc. So I should be able to free it
just fine.

Please anyone who has written C extensions or the author of Win32OLE,
let me know what is wrong with calling free on pointers allocated with
ALLOC_N.

Thanks in advance,

Steve Tuckner
 
T

ts

S> Please anyone who has written C extensions or the author of Win32OLE,
S> let me know what is wrong with calling free on pointers allocated with
S> ALLOC_N.

Well there is nothing wrong with calling free with ALLOC_N because like
you've found ALLOC_N is just a call to malloc().

But if it exist an error in the C extensions (bad memory management
*elsewhere*) then the memory pool can be corrupted and this can explain
the crash.

Perhaps the error is in the extension Win32OLE (well, I don't know what
do this extension and I've not looked at the source)


Guy Decoux
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top