* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef _DALVIK_ALLOC_MARK_SWEEP
-#define _DALVIK_ALLOC_MARK_SWEEP
+#ifndef DALVIK_ALLOC_MARK_SWEEP_H_
+#define DALVIK_ALLOC_MARK_SWEEP_H_
#include "alloc/HeapBitmap.h"
#include "alloc/HeapSource.h"
-typedef struct {
+struct GcMarkStack {
/* Highest address (exclusive)
*/
const Object **limit;
/* Maximum stack size, in bytes.
*/
size_t length;
-} GcMarkStack;
+};
/* This is declared publicly so that it can be included in gDvm.gcHeap.
*/
-typedef struct {
+struct GcMarkContext {
HeapBitmap *bitmap;
GcMarkStack stack;
const char *immuneLimit;
const void *finger; // only used while scanning/recursing.
-} GcMarkContext;
+};
-bool dvmHeapBeginMarkStep(GcMode mode);
+bool dvmHeapBeginMarkStep(bool isPartial);
void dvmHeapMarkRootSet(void);
void dvmHeapReMarkRootSet(void);
void dvmHeapScanMarkedObjects(void);
void dvmHeapReScanMarkedObjects(void);
-void dvmHandleSoftRefs(Object **list);
-void dvmClearWhiteRefs(Object **list);
-void dvmHeapScheduleFinalizations(void);
+void dvmHeapProcessReferences(Object **softReferences, bool clearSoftRefs,
+ Object **weakReferences,
+ Object **finalizerReferences,
+ Object **phantomReferences);
void dvmHeapFinishMarkStep(void);
void dvmHeapSweepSystemWeaks(void);
-void dvmHeapSweepUnmarkedObjects(GcMode mode, bool isConcurrent,
+void dvmHeapSweepUnmarkedObjects(bool isPartial, bool isConcurrent,
size_t *numObjects, size_t *numBytes);
+void dvmEnqueueClearedReferences(Object **references);
-#endif // _DALVIK_ALLOC_MARK_SWEEP
+#endif // DALVIK_ALLOC_MARK_SWEEP_H_