diff options
author | Carl Shapiro <cshapiro@google.com> | 2010-01-07 21:35:50 -0800 |
---|---|---|
committer | Carl Shapiro <cshapiro@google.com> | 2010-01-11 17:44:02 -0800 |
commit | 5a6071b914e7669eaf032256f163f65403bfcf3b (patch) | |
tree | 0142097cc0540a1ed670e08c9e9aa15b8e40a1ea /vm/Sync.h | |
parent | 5f56e67999c67861872c27097803d2126142fed4 (diff) | |
download | android_dalvik-5a6071b914e7669eaf032256f163f65403bfcf3b.tar.gz android_dalvik-5a6071b914e7669eaf032256f163f65403bfcf3b.tar.bz2 android_dalvik-5a6071b914e7669eaf032256f163f65403bfcf3b.zip |
Separately sweep the monitor list before sweeping the heap. Required
for the copying collector so we can abandon objects without examining
their headers. There is a liminal reduction in sweep time when using
the non-moving collector. In addition, this change uncomments a call
to free to reclaim the monitor when its owning object is unmarked.
Diffstat (limited to 'vm/Sync.h')
-rw-r--r-- | vm/Sync.h | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -101,15 +101,12 @@ void dvmThreadInterrupt(struct Thread* thread); /* create a new Monitor struct */ Monitor* dvmCreateMonitor(struct Object* obj); -/* free an object's monitor during GC */ -void dvmFreeObjectMonitor_internal(u4 *lock); -#define dvmFreeObjectMonitor(obj) \ - do { \ - Object *DFM_obj_ = (obj); \ - if (IS_LOCK_FAT(&DFM_obj_->lock)) { \ - dvmFreeObjectMonitor_internal(&DFM_obj_->lock); \ - } \ - } while (0) +/* + * Frees unmarked monitors from the monitor list. The given callback + * routine should return a non-zero value when passed a pointer to an + * unmarked object. + */ +void dvmSweepMonitorList(Monitor** mon, int (*isUnmarkedObject)(void*)); /* free monitor list */ void dvmFreeMonitorList(void); |