mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Added comment, switch to >=
This commit is contained in:
parent
391051ba7b
commit
063e5c8c73
1 changed files with 5 additions and 1 deletions
6
gc.c
6
gc.c
|
@ -531,7 +531,11 @@ void *gc_try_alloc(gc_heap * h, int heap_type, size_t size, char *obj,
|
|||
gc_heap *h_passed = h;
|
||||
gc_free_list *f1, *f2, *f3;
|
||||
pthread_mutex_lock(&heap_lock);
|
||||
if (size <= h->last_alloc_size) {
|
||||
// Start searching from the last heap page we had a successful
|
||||
// allocation from, unless the current request is for a smaller
|
||||
// block in which case there may be available memory closer to
|
||||
// the start of the heap.
|
||||
if (size >= h->last_alloc_size) {
|
||||
h = h->next_free;
|
||||
}
|
||||
for (; h; h = h->next) { // All heaps
|
||||
|
|
Loading…
Add table
Reference in a new issue