• Kevin Modzelewski's avatar
    Debugging helper: invalidate freed objects · 6fa582e4
    Kevin Modzelewski authored
    Without this, one could use freed objects without issues,
    until something else was allocated in that space.  And even then,
    it would still be a valid object.
    
    So, in debug mode overwrite the data with garbage to try to surface
    these issues.
    
    This exposed an issue with our "nonheap roots" handling, where we
    weren't scanning all of the memory that they pointed to.  This is
    mostly fine, but there are some cases (time.gmtime) where gc-allocated
    memory would be stored in these objects.  So, now you have to register
    the size of the object, and the memory range will be scanned conservatively.
    6fa582e4
collector.cpp 13.6 KB