Open civodul opened 7 years ago
I wonder if users follow the GC_PROC_BYTES
limit. For instance, the (now defunct) libjava in GCC had a _Jv_MarkArray
function that marks each array element, regardless of its size.
GC_new_kind (GC_new_free_list (), GC_MAKE_PROC (GC_new_proc (mark_array), 0), 0, 0)
BTW. This call is wrong: clear argument should be true (I have added an assertion about it - 43a6189)
Is there an example of an incremental mark procedure? How’s one supposed to carry the appropriate mark state? I wonder if users follow the GC_PROC_BYTES limit. For instance, the (now defunct) libjava in GCC had a _Jv_MarkArray function that marks each array element, regardless of its size.
@hboehm Could you please comment on this items?
I am also trying to implement an incremental mark procedure. I wonder if the 'env' argument is supposed to be used to carry the mark state, the amount of marking work that has been done.
I'm looking for a function that can push a new descriptor onto the mark stack - something like this.
https://github.com/ivmai/bdwgc/blob/57b97be07c514fcc4b608b13768fd2bf637a5899/typd_mlc.c#L364
Question 2: I see above that civodul has a mutex in their object that they lock while they are marking it. Is this necessary in a multithreaded context? We use boehm with multiple threads in the conservative mode and I'd like to keep using it with multithreaded code when we add a precise mode for boehm.
(I noticed that opendylan.org and the mailing list are down, so I'm writing here...)
I’m trying to write a custom mark procedure that follows these guidelines from
<gc/gc_mark.h>
:The code below shows my interpretation of this: the mark procedure scans at most
GC_PROC_BYTES
, it saves the index where it stopped scanning the object, and pushes the object back on the mark stack; on the next call, it resumes scanning at the index that it recorded. Here's the code:This approach doesn’t work: the
GC_size
call inmain
eventually segfaults, meaning that we stumbled upon an entry that was GC’d.Is there an example of an incremental mark procedure? How’s one supposed to carry the appropriate mark state?