* Fixed build with PARANOID_HEAP_VALIDATION.
* heap_index_for(): Could return invalid index, if there hadn't been created a set of heaps for each CPU. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35179 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4ac2299989
commit
3da8837069
@ -1808,7 +1808,7 @@ heap_index_for(size_t size, int32 cpu)
|
||||
break;
|
||||
}
|
||||
|
||||
return index + cpu * HEAP_CLASS_COUNT;
|
||||
return (index + cpu * HEAP_CLASS_COUNT) % sHeapCount;
|
||||
}
|
||||
|
||||
|
||||
@ -2110,6 +2110,10 @@ memalign(size_t alignment, size_t size)
|
||||
shouldGrow = heap_should_grow(heap);
|
||||
break;
|
||||
}
|
||||
|
||||
#if PARANOID_HEAP_VALIDATION
|
||||
heap_validate_heap(heap);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (result == NULL) {
|
||||
@ -2128,10 +2132,6 @@ memalign(size_t alignment, size_t size)
|
||||
release_sem_etc(sHeapGrowSem, 1, B_DO_NOT_RESCHEDULE);
|
||||
}
|
||||
|
||||
#if PARANOID_HEAP_VALIDATION
|
||||
heap_validate_heap(heap);
|
||||
#endif
|
||||
|
||||
if (result == NULL)
|
||||
panic("heap: kernel heap has run out of memory\n");
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user