|
@@ -129,6 +129,7 @@ static gc_pheader *gc_allocator_new_page( int pid, int block, int size, int kind
|
|
|
// increase size based on previously allocated pages
|
|
|
if( block < 256 ) {
|
|
|
int num_pages = 0;
|
|
|
+ int count = 1;
|
|
|
gc_pheader *ph = gc_pages[pid];
|
|
|
while( ph ) {
|
|
|
num_pages++;
|
|
@@ -136,7 +137,12 @@ static gc_pheader *gc_allocator_new_page( int pid, int block, int size, int kind
|
|
|
}
|
|
|
while( num_pages > 8 && (size<<1) / block <= GC_PAGE_SIZE ) {
|
|
|
size <<= 1;
|
|
|
+ count <<= 1;
|
|
|
num_pages /= 3;
|
|
|
+# ifdef HL_NX
|
|
|
+ // do not allocate too much large pages with low memory
|
|
|
+ if( count == 4 ) break;
|
|
|
+# endif
|
|
|
}
|
|
|
}
|
|
|
|