summaryrefslogtreecommitdiff
path: root/backend/src/sys
diff options
context:
space:
mode:
authorBenjamin Segovia <bsegovia@bsegovia-i70.sc.intel.com>2012-10-04 22:08:10 +0000
committerBenjamin Segovia <bsegovia@bsegovia-i70.sc.intel.com>2012-10-04 22:08:10 +0000
commit94f676fd3ded81da4d5e171f53342d8916014ad4 (patch)
tree19920fe3c0ff427a39eb28530244d2ed4f28bd38 /backend/src/sys
parente47e7cbb1f55ad6d5bb98c6c9f23a4c6a6826830 (diff)
Almost finished instruction scheduling. Just need to handle accumulator write
update when AccWrEn is set
Diffstat (limited to 'backend/src/sys')
-rw-r--r--backend/src/sys/alloc.hpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/backend/src/sys/alloc.hpp b/backend/src/sys/alloc.hpp
index cec406e6..29208fec 100644
--- a/backend/src/sys/alloc.hpp
+++ b/backend/src/sys/alloc.hpp
@@ -195,12 +195,8 @@ namespace gbe
this->full = this->curr;
// Try to pick up a free block
- if (this->free) {
- GBE_ASSERT(this->free->allocated < this->free->maxElemNum);
- this->curr = this->free;
- this->free = this->free->next;
- this->curr->next = NULL;
- }
+ if (this->free) this->getFreeBlock();
+
// No free block we must allocate a new one
else
this->curr = GBE_NEW(GrowingPoolElem, 2 * this->curr->maxElemNum);
@@ -238,14 +234,19 @@ namespace gbe
this->free = this->full;
this->full = next;
}
+
// Provide a valid current block
+ this->getFreeBlock();
+#endif /* GBE_DEBUG_SPECIAL_ALLOCATOR */
+ }
+ private:
+ /*! Pick-up a free block */
+ INLINE void getFreeBlock(void) {
GBE_ASSERT(this->free);
this->curr = this->free;
this->free = this->free->next;
this->curr->next = NULL;
-#endif /* GBE_DEBUG_SPECIAL_ALLOCATOR */
}
- private:
/*! Chunk of elements to allocate */
class GrowingPoolElem
{