mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-03 12:31:57 +00:00
try to find a contiguous block until it finds or there is no more memory
This commit is contained in:
parent
e2bbff5a94
commit
6c1367eed9
@ -255,6 +255,8 @@ void *malloc_contiguous(size_t size)
|
||||
size_t part_size;
|
||||
|
||||
tmp = malloc(size);
|
||||
if (tmp == NULL)
|
||||
return NULL;
|
||||
|
||||
if (check_full_in_bank((unsigned long)tmp, size))
|
||||
return tmp;
|
||||
@ -268,15 +270,9 @@ void *malloc_contiguous(size_t size)
|
||||
free(tmp);
|
||||
|
||||
tmp = malloc(part_size);
|
||||
contiguous = malloc(size);
|
||||
contiguous = malloc_contiguous(size);
|
||||
free(tmp);
|
||||
|
||||
if (!check_full_in_bank((unsigned long)contiguous, size))
|
||||
{
|
||||
free(contiguous);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return contiguous;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user