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:
@@ -44,6 +44,13 @@ threadHeap::threadHeap(void)
|
|||||||
void *
|
void *
|
||||||
threadHeap::malloc(const size_t size)
|
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);
|
const int sizeclass = sizeClass(size);
|
||||||
block *b = NULL;
|
block *b = NULL;
|
||||||
|
|
||||||
@@ -54,7 +61,6 @@ threadHeap::malloc(const size_t size)
|
|||||||
// superblock list.
|
// superblock list.
|
||||||
|
|
||||||
superblock *sb = findAvailableSuperblock(sizeclass, b, _pHeap);
|
superblock *sb = findAvailableSuperblock(sizeclass, b, _pHeap);
|
||||||
|
|
||||||
if (sb == NULL) {
|
if (sb == NULL) {
|
||||||
// We don't have memory locally.
|
// We don't have memory locally.
|
||||||
// Try to get more from the process heap.
|
// Try to get more from the process heap.
|
||||||
|
|||||||
Reference in New Issue
Block a user