From: ts Date: 2006-09-13T17:57:28+09:00 Subject: Re: Wrapping a C Library: Allocation and duplication issues >>>>> "J" == Justin Bonnar writes: J> The following code compiles and runs, but doesn't seem to work correctly J> (other functions that access the C structure wrapped by the object J> behave strangely.) Look at ruby-1.8.5/ext/dbm/dbm.c, in the ruby source, to see an example how you can do this (fdbm_alloc(), free_dbm() and fdbm_initialize()) Guy Decoux