Subject:
[ruby-ffi] convert free -> xfree?
From:
Jon
Date:
12/11/09 9:48 AM
To:
ruby-ffi@googlegroups.com

From http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/22727 in the "Mixing runtime libraries" section the claim that you can mix msft c runtimes if

* If you call ALLOC or ALLOC_N, use xfree and not free
* Don't call sprintf or printf in an extension, instead use rb_f_sprintf/rb_vsprintf/rb_io_printf

...does it make sense to change these free's to xfree's (not libffi's dlmalloc?) in ruby-ffi?


C:\Users\Jon\Documents\RubyDev\ffi-trunk>grep -Rn " free(" ext

ext/ffi_c/Buffer.c:154:        free(ptr->storage);
ext/ffi_c/ClosurePool.c:131:        free(memory->data);
ext/ffi_c/ClosurePool.c:132:        free(memory);
ext/ffi_c/ClosurePool.c:135:    free(pool);
ext/ffi_c/ClosurePool.c:218:    free(block);
ext/ffi_c/ClosurePool.c:219:    free(list);
ext/ffi_c/libffi/src/dlmalloc.c:678:  free(void* p)
ext/ffi_c/libffi/src/dlmalloc.c:857:    free(pool);     // Can now free the array (or not, if it is needed later)
ext/ffi_c/MemoryPointer.c:137:            free(ptr->storage);
ext/ffi_c/Type.c:162:    free(type->name);