R
rohits123
To optimize the memory usage , I am using a huge block of memory for
my system and
then dividing the initial chunk in to 4 pools.
I have overloaded new and delete such that memory from a particular
pool can be taken and
freed .
As far as possible memory can be taken from particular pool and memory
is freed (comlete pool as whole ) when pool is completely used.
By overlaoding new and delete , I can pass the information about a
particular pool say:
CMyClass* myClass = new (POOL_1) CMyClass;
....
delete(POOL_1) s;
But the problem is while using the abtsract containers say vector, I
am not able the POOL related information till new and delete which are
used inside allocator.
I am using the userdefined allocator :
vector<int,MySpace::MyAllocator<int> > v;
so that overloaded version of new and delete are called , but it is
not possible to pass the POOL related information in case of
containers .
Any suggestions ?
my system and
then dividing the initial chunk in to 4 pools.
I have overloaded new and delete such that memory from a particular
pool can be taken and
freed .
As far as possible memory can be taken from particular pool and memory
is freed (comlete pool as whole ) when pool is completely used.
By overlaoding new and delete , I can pass the information about a
particular pool say:
CMyClass* myClass = new (POOL_1) CMyClass;
....
delete(POOL_1) s;
But the problem is while using the abtsract containers say vector, I
am not able the POOL related information till new and delete which are
used inside allocator.
I am using the userdefined allocator :
vector<int,MySpace::MyAllocator<int> > v;
so that overloaded version of new and delete are called , but it is
not possible to pass the POOL related information in case of
containers .
Any suggestions ?