From 05f5f17e0fe28c0ed0be341e5c0916c9a0a996a6 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 13 Nov 2011 15:56:04 +0000 Subject: Fix SF/3436999 * utils/storage.H: Revert accidental commit of unfinished changes. --- src/ChangeLog | 5 ++++ src/utils/storage.H | 76 ----------------------------------------------------- 2 files changed, 5 insertions(+), 76 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 8da85ba8..c9293590 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-11-13 Gabriel Dos Reis + + Fix SF/3436999 + * utils/storage.H: Revert accidental commit of unfinished changes. + 2011-11-13 Gabriel Dos Reis * interp/sys-driver.boot (initializeDatabases): Honor --initial-db. diff --git a/src/utils/storage.H b/src/utils/storage.H index f2fdc8ae..72b9eb1e 100644 --- a/src/utils/storage.H +++ b/src/utils/storage.H @@ -42,7 +42,6 @@ #include #include #include -#include #include @@ -196,28 +195,6 @@ namespace OpenAxiom { size_t population() const; protected: - // +----+----+--+----- - // | | | | - // +----+----+--+----- - // ^ ^ ^ ^ - // | | | `-- first allocatable T object - // | | `-- possible padding for proper T alignment - // | `-- link to next storage pages - // `-- link to previous storage pages - enum { - link_size = sizeof(Storage*) - }; - - // The `previous' link in the chain of storage. - static Storage*& previous(Storage* s) { - return *static_cast(s->at_offset(0)); - } - - // The `next' link in the chain of storage. - static Storage*& next(Storage* s) { - return *static_cast(s->at_offset(link_size)); - } - // Address of the first object of type `T' in a storage. static T* first_object(Handle* h) { return static_cast(BlockStorage::begin(h)); @@ -287,18 +264,6 @@ namespace OpenAxiom { Factory() : Arena(nominal_population()) { } ~Factory(); - iterator begin() { - Storage* s = this->store; - while (Storage* p = Arena::previous(s)) - s = p; - return iterator(s, Arena::first_object(s)); - } - - iterator end() { - Storage* s = this->store; - return iterator(s, static_cast(s->next_available())); - } - // Allocate storage and value-construct an object of type `T'. T* make() { return new(this->allocate(1)) T(); @@ -342,47 +307,6 @@ namespace OpenAxiom { } } - template - struct Factory::iterator: - std::iterator { - - iterator& operator++() { - if (ptr < store->next_available()) { - ++ptr; - return *this; - } - store = Arena::next(store); - ptr = Arena::first_object(store); - return *this; - } - - iterator operator++(int) { - iterator t = *this; - ++*this; - return t; - } - - T* operator->() { return ptr; } - - T& operator*() { return *ptr; } - - friend bool operator==(iterator p, iterator q) { - return p.store == q.store and p.ptr == q.ptr; - } - - friend bool operator!=(iterator p, iterator q) { - return not(p == q); - } - - private: - Storage* store; - T* ptr; - friend class Factory; - - iterator(Storage* s, T* p) : store(s), ptr(p) { } - - }; - // ----------------- // -- FileMapping -- // ----------------- -- cgit v1.2.3