#63: removed object length storing

This commit is contained in:
Louis Rubet 2017-05-22 17:27:54 +02:00
parent 9c13206818
commit 1232cb10da

View file

@ -32,7 +32,6 @@ public:
{ {
_current = _base; _current = _base;
_vpointer.clear(); _vpointer.clear();
_vlen.clear();
_count = 0; _count = 0;
} }
@ -72,7 +71,6 @@ public:
} }
// manage stack itself // manage stack itself
_vlen.push_back(size);
_vpointer.push_back((object*)_current); _vpointer.push_back((object*)_current);
allocated = (object*)_current; allocated = (object*)_current;
_current += size; _current += size;
@ -94,7 +92,6 @@ public:
if (_count > 0) if (_count > 0)
{ {
_current = (char*)_vpointer[_count - 1]; _current = (char*)_vpointer[_count - 1];
_vlen.pop_back();
_vpointer.pop_back(); _vpointer.pop_back();
_count--; _count--;
@ -135,7 +132,7 @@ public:
unsigned int get_len(unsigned int index) unsigned int get_len(unsigned int index)
{ {
if (index<_count) if (index<_count)
return _vlen[_count-index-1]; return _vpointer[_count-index-1]->_size;
else else
return 0; return 0;
} }
@ -160,7 +157,7 @@ public:
unsigned int seq_len(unsigned int index) unsigned int seq_len(unsigned int index)
{ {
if (index<_count) if (index<_count)
return _vlen[index]; return _vpointer[index]->_size;
else else
return 0; return 0;
} }
@ -178,7 +175,6 @@ private:
char* _current; char* _current;
vector<object*> _vpointer;//pointer on each entry vector<object*> _vpointer;//pointer on each entry
vector<unsigned int> _vlen;// size of each entry in bytes
unsigned int _count;// =_vlen.size()=_vpointer.size() unsigned int _count;// =_vlen.size()=_vpointer.size()
unsigned int _total_size;//total allocated size in bytes unsigned int _total_size;//total allocated size in bytes
}; };