[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Win32OLE again

Steve Tuckner

10/28/2003 11:06:00 PM



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




1 Answer

ts

10/29/2003 11:35:00 AM

0

>>>>> "S" == Steve Tuckner <STUCKNER@MULTITECH.COM> writes:

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