The maximum allocation size we've configured our allocator is 1 GB. Instead

of running into an assert() later on, we now back out early in this case.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12902 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-05-30 14:10:06 +00:00
parent 9a92483e6f
commit ac5af8f1b4

View File

@ -44,6 +44,13 @@ threadHeap::threadHeap(void)
void *
threadHeap::malloc(const size_t size)
{
#if MAX_INTERNAL_FRAGMENTATION == 2
if (size > 1063315264UL) {
debug_printf("malloc() of %lu bytes asked\n", size);
return NULL;
}
#endif
const int sizeclass = sizeClass(size);
block *b = NULL;
@ -54,7 +61,6 @@ threadHeap::malloc(const size_t size)
// superblock list.
superblock *sb = findAvailableSuperblock(sizeclass, b, _pHeap);
if (sb == NULL) {
// We don't have memory locally.
// Try to get more from the process heap.