diff options
author | dos-reis <gdr@axiomatics.org> | 2011-11-13 15:56:04 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-11-13 15:56:04 +0000 |
commit | 05f5f17e0fe28c0ed0be341e5c0916c9a0a996a6 (patch) | |
tree | fa29ed335e67e1bb74bb5f02fa370c4d889b6538 /src | |
parent | 4d0c8ae73e443bbfae3793a1313e0e5c5cf0c6a7 (diff) | |
download | open-axiom-05f5f17e0fe28c0ed0be341e5c0916c9a0a996a6.tar.gz |
Fix SF/3436999
* utils/storage.H: Revert accidental commit of unfinished changes.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/utils/storage.H | 76 |
2 files changed, 5 insertions, 76 deletions
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 <gdr@cse.tamu.edu> + + Fix SF/3436999 + * utils/storage.H: Revert accidental commit of unfinished changes. + 2011-11-13 Gabriel Dos Reis <gdr@cs.tamu.edu> * 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 <new> #include <cmath> #include <string> -#include <iterator> #include <open-axiom/config> @@ -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<Storage**>(s->at_offset(0)); - } - - // The `next' link in the chain of storage. - static Storage*& next(Storage* s) { - return *static_cast<Storage**>(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<T*>(BlockStorage::begin(h)); @@ -287,18 +264,6 @@ namespace OpenAxiom { Factory() : Arena<T>(nominal_population()) { } ~Factory(); - iterator begin() { - Storage* s = this->store; - while (Storage* p = Arena<T>::previous(s)) - s = p; - return iterator(s, Arena<T>::first_object(s)); - } - - iterator end() { - Storage* s = this->store; - return iterator(s, static_cast<T*>(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<typename T> - struct Factory<T>::iterator: - std::iterator<std::forward_iterator_tag, T> { - - iterator& operator++() { - if (ptr < store->next_available()) { - ++ptr; - return *this; - } - store = Arena<T>::next(store); - ptr = Arena<T>::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<T>; - - iterator(Storage* s, T* p) : store(s), ptr(p) { } - - }; - // ----------------- // -- FileMapping -- // ----------------- |