Barry Bond wrote: > The SSCLI's garbage collector can allocate from more than one chunk of > memory. g_lowest_address and g_highest_address represent the lowest and > highest addresses that *may* contain garbage collected heaps, and are > used to quickly estimate whether a pointer is within the GC heap or not. >
i am looking at a collector with two semispaces that uses a copying scheme & there is a need to support dynamic expansion, initially we tried having just a single chunk of memory with a fixed start addr and tried to support expansion but it didnt work out so there are 2 chunks one for each space (they need not be contiguous) Some of the functions like the write barrier and GcSafeMemcpy in rotor do a validation check of the address wrt g_lowest and g_highest so was trying to find out how the validation check has to be done in this case ? since g_lowest and g_highest form part of the Interface one is supposed to use them and not make changes to these functions. Is there a way to solve this problem? > For example, take a look at GCHeap::IsHeapPointer() in > sscli/src/clr/src/vm/gcsmp.cpp. You can see the range-check that the > pointer is between g_lowest_address and g_highest_address, and only if > it is, IsHeapPointer() calls gcheap::find_segment to determine which (if > any) GC heap segment contains the pointer. > > Barry thank you, archana