J
jared.r.richardson
Hi all,
I'm working on a database driver for the Ingres database and I'm nearly
done but I've got one outstanding issue. Initially I thought it was a
bug in rb_ary_new but now I'm wonding if it's a problem with garbage
collection.
I have several arrays that I declare globally in my C code. Each holds
a collection of VALUE objects that are created locally within the
routines. The contents of the arrays (the VALUE objects) will
eventually corrupt on a long running program. (If it matters, the
largest of these arrays is an array of arrays holding a result set.)
I've traced the corruption to a rb_ary_new call. On the line before the
rb_ary_new, the data within the array is good. On the line after,
trying to print the data causes a segmentation fault.
So my question is this: will the GC collect a VALUE object that lives
within a global array? I thought storing the local variables withing a
global variable would be a good enough reference to keep the data safe.
Any thoughts would be appreciated!
Jared
http://jaredrichardson.net
I'm working on a database driver for the Ingres database and I'm nearly
done but I've got one outstanding issue. Initially I thought it was a
bug in rb_ary_new but now I'm wonding if it's a problem with garbage
collection.
I have several arrays that I declare globally in my C code. Each holds
a collection of VALUE objects that are created locally within the
routines. The contents of the arrays (the VALUE objects) will
eventually corrupt on a long running program. (If it matters, the
largest of these arrays is an array of arrays holding a result set.)
I've traced the corruption to a rb_ary_new call. On the line before the
rb_ary_new, the data within the array is good. On the line after,
trying to print the data causes a segmentation fault.
So my question is this: will the GC collect a VALUE object that lives
within a global array? I thought storing the local variables withing a
global variable would be a good enough reference to keep the data safe.
Any thoughts would be appreciated!
Jared
http://jaredrichardson.net