kernel/eka/klib/kheap.cpp
branchRCL_3
changeset 256 c1f20ce4abcf
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kernel/eka/klib/kheap.cpp	Thu Aug 19 11:14:22 2010 +0300
+++ b/kernel/eka/klib/kheap.cpp	Tue Aug 31 16:34:26 2010 +0300
@@ -20,7 +20,7 @@
 _LIT(KLitKernHeap,"KernHeap");
 
 RHeapK::RHeapK(TInt aInitialSize)
-	: RHeap(aInitialSize, 0, EFalse)
+	: RHybridHeap(aInitialSize, 0, EFalse)			
 	{
 	}
 
@@ -59,8 +59,7 @@
 // Create a kernel fixed heap.
 //
 	{
-
-	__ASSERT_ALWAYS(aInitialSize>KMinHeapSize, K::Fault(K::ETHeapMaxLengthNegative));
+	__ASSERT_ALWAYS(aInitialSize>(TInt)sizeof(RHeapK), K::Fault(K::ETHeapMaxLengthNegative));
 	return new(aBase) RHeapK(aInitialSize);
 	}
 
@@ -76,6 +75,20 @@
 	__ASSERT_CRITICAL;
 	}
 
+void RHybridHeap::Lock() const   
+	{
+	DMutex* m = *(DMutex**)&iLock;
+	if (m)
+		Kern::MutexWait(*m);
+	}
+
+void RHybridHeap::Unlock() const   
+	{
+	DMutex* m = *(DMutex**)&iLock;
+	if (m)
+		Kern::MutexSignal(*m);
+	}
+
 void RHeapK::Fault(TInt aFault)
 	{
 	Kern::Fault("KERN-HEAP", aFault);