| Index: vm/freelist.h
|
| ===================================================================
|
| --- vm/freelist.h (revision 2918)
|
| +++ vm/freelist.h (working copy)
|
| @@ -20,8 +20,17 @@
|
| // the address following the next_ field.
|
| class FreeListElement {
|
| public:
|
| - FreeListElement* next() const { return next_; }
|
| - void set_next(FreeListElement* next) { next_ = next; }
|
| + FreeListElement* next() const {
|
| + // Clear the FreeBit.
|
| + ASSERT((next_ & RawObject::kFreeBit) == 1);
|
| + return reinterpret_cast<FreeListElement*>(next_ ^ RawObject::kFreeBit);
|
| + }
|
| + void set_next(FreeListElement* next) {
|
| + // Set the FreeBit.
|
| + uword addr = reinterpret_cast<uword>(next);
|
| + ASSERT((addr & RawObject::kFreeBit) == 0);
|
| + next_ = addr | RawObject::kFreeBit;
|
| + }
|
|
|
| intptr_t Size() const {
|
| if (class_ == minimal_element_class_) {
|
| @@ -42,7 +51,7 @@
|
| private:
|
| // This layout mirrors the layout of RawObject.
|
| RawClass* class_;
|
| - FreeListElement* next_;
|
| + uword next_;
|
|
|
| // Returns the address of the embedded size.
|
| intptr_t* SizeAddress() const {
|
|
|