How do I keep track of how much marking work I've done when implementing my own mark procedure? I am working to use the Boehm Weiser Garbage Collector in precise mode. I need to implement my own mark procedures. For large objects like vectors that contain lots of pointers - the gc_mark.h header file says that I should break the work up into smaller pieces and push the object whose pointers I'm marking back onto the stack to continue marking later. I can add a size_t work_to_do field to the object and use that - but I see the env argument that is passed to the GC_mark_proc. Is the env argument meant to store the amount of work done?
typedef struct GC_ms_entry * (*GC_mark_proc)(GC_word * /* addr */,
struct GC_ms_entry * /* mark_stack_ptr */,
struct GC_ms_entry * /* mark_stack_limit */,
GC_word /* env */);
The env value is set when the kind of the object is defined with GC_new_kind and GC_MAKE_PROC - after that there doesn't appear to be a mechanism to update it. This makes me think that env is not what I'm looking for. If not - what is the purpose of env?