--- a/kernel/eka/memmodel/epoc/flexible/mmu/mvalloc.cpp Fri Apr 16 16:24:37 2010 +0300
+++ b/kernel/eka/memmodel/epoc/flexible/mmu/mvalloc.cpp Mon May 03 13:47:38 2010 +0300
@@ -688,7 +688,7 @@
RVirtualAllocSlabSet* RVirtualAllocSlabSet::New(RVirtualAllocator* aAllocator, TUint aNumSlabTypes, DMutex*& aWriteLock)
{
- TUint size = sizeof(RVirtualAllocSlabSet)+sizeof(((RVirtualAllocSlabSet*)0x100)->iSlabs)*(aNumSlabTypes-1);
+ TUint size = sizeof(RVirtualAllocSlabSet) + sizeof(SDblQue) * (aNumSlabTypes - 1);
RVirtualAllocSlabSet* set = (RVirtualAllocSlabSet*)Kern::AllocZ(size);
if(set)
new (set) RVirtualAllocSlabSet(aAllocator,aNumSlabTypes,aWriteLock);
@@ -764,8 +764,9 @@
if(!slab)
return KErrNoMemory;
TLinAddr addr = slab->Alloc(aSizeShift);
- if(!addr)
- return KErrNoMemory;
+ // Shouldn't ever fail as we've just allocated an empty slab and we can't
+ // attempt to allocate more than a whole slab.
+ __NK_ASSERT_DEBUG(addr);
aAddr = addr;
return KErrNone;
}
@@ -830,8 +831,8 @@
RVirtualAllocator::~RVirtualAllocator()
{
__NK_ASSERT_DEBUG(iAllocator==0 || iAllocator->iAvail==iAllocator->iSize); // should be empty
- Kern::Free(iAllocator);
- Kern::Free(iSlabSet);
+ delete iAllocator;
+ delete iSlabSet;
}