summaryrefslogtreecommitdiffstats
path: root/runtime/gc/space/zygote_space.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/gc/space/zygote_space.h')
-rw-r--r--runtime/gc/space/zygote_space.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/runtime/gc/space/zygote_space.h b/runtime/gc/space/zygote_space.h
index e0035b31a5..8cd1a9f488 100644
--- a/runtime/gc/space/zygote_space.h
+++ b/runtime/gc/space/zygote_space.h
@@ -30,7 +30,7 @@ class SpaceBitmap;
namespace space {
// An zygote space is a space which you cannot allocate into or free from.
-class ZygoteSpace : public ContinuousMemMapAllocSpace {
+class ZygoteSpace FINAL : public ContinuousMemMapAllocSpace {
public:
// Returns the remaining storage in the out_map field.
static ZygoteSpace* Create(const std::string& name, MemMap* mem_map,
@@ -39,40 +39,40 @@ class ZygoteSpace : public ContinuousMemMapAllocSpace {
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
void Dump(std::ostream& os) const;
- virtual SpaceType GetType() const {
+
+ SpaceType GetType() const OVERRIDE {
return kSpaceTypeZygoteSpace;
}
- virtual ZygoteSpace* AsZygoteSpace() {
+
+ ZygoteSpace* AsZygoteSpace() OVERRIDE {
return this;
}
- virtual mirror::Object* AllocWithGrowth(Thread* /*self*/, size_t /*num_bytes*/,
- size_t* /*bytes_allocated*/) {
- LOG(FATAL) << "Unimplemented";
- return nullptr;
- }
- virtual mirror::Object* Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated) {
- LOG(FATAL) << "Unimplemented";
- return nullptr;
- }
- virtual size_t AllocationSize(mirror::Object* obj) {
- LOG(FATAL) << "Unimplemented";
- return 0;
- }
- virtual size_t Free(Thread* self, mirror::Object* ptr) {
- LOG(FATAL) << "Unimplemented";
- return 0;
+
+ mirror::Object* Alloc(Thread* self, size_t num_bytes, size_t* bytes_allocated,
+ size_t* usable_size) OVERRIDE;
+
+ size_t AllocationSize(mirror::Object* obj, size_t* usable_size) OVERRIDE;
+
+ size_t Free(Thread* self, mirror::Object* ptr) OVERRIDE;
+
+ size_t FreeList(Thread* self, size_t num_ptrs, mirror::Object** ptrs) OVERRIDE;
+
+ // ZygoteSpaces don't have thread local state.
+ void RevokeThreadLocalBuffers(art::Thread*) OVERRIDE {
}
- virtual size_t FreeList(Thread* self, size_t num_ptrs, mirror::Object** ptrs) {
- LOG(FATAL) << "Unimplemented";
- return 0;
+ void RevokeAllThreadLocalBuffers() OVERRIDE {
}
- virtual uint64_t GetBytesAllocated() {
+
+ uint64_t GetBytesAllocated() {
return Size();
}
- virtual uint64_t GetObjectsAllocated() {
+
+ uint64_t GetObjectsAllocated() {
return objects_allocated_;
}
+ void Clear();
+
protected:
virtual accounting::SpaceBitmap::SweepCallback* GetSweepCallback() {
return &SweepCallback;