[MLton] MLton Object Root Sets
muyuanli <[email protected]> Tue, 8 Sep 2015 00:41:32 -0400
| Newsgroups | gmane.comp.lang.ml.mlton.devel |
|---|---|
| Message-ID | <CAGmT-V5QUzgOPX-R8F=ZjoRC77+c1PUbDHu9BxMRme2wfegGxQ@mail.gmail.com> |
Hi,
I'm writing a simple real time mark & sweep GC for MLton and I
encountered some problems:
1. In the Mark & Sweep phase, it looks like the GC wind up collecting
some objects that are still in use. I wonder if I missed some objects
in the root sets for DFS mark. The code logic looks like:
performGC:
GC_stack currentStack = getStackCurrent(s);
foreachGlobalObjptr (s, markObjects);
foreachObjptrInObject(s, (pointer) currentStack, markObjects, FALSE);
// sweep & clean mark
2. In the object allocation phase, I saw some arrays allocated with
length 0. What is the purpose with these arrays?
Thanks and appreciate your help!
Thanks,
Bruce
--
Muyuan Li
MS @ Dept of Computer Science and Engineering
University at Buffalo
------------------------------------------------------------------------------