move allocation log message to before allocating
and print result
This commit is contained in:
parent
78159f4f04
commit
45cc672af1
@ -66,10 +66,15 @@ static NOINLINE void* BN(allocateMore)(i64 bucket, u8 type, i64 from, i64 to) {
|
|||||||
thrOOM();
|
thrOOM();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if LOG_GC || LOG_MM_MORE
|
||||||
|
fprintf(stderr, "allocating "N64u" more " str1(BN()) " heap (from allocation of "N64u"B/bucket %d)", sz, (u64)BSZ(bucket), (int)bucket);
|
||||||
|
#endif
|
||||||
#if NO_MMAP
|
#if NO_MMAP
|
||||||
EmptyValue* c = calloc(sz+getPageSize(), 1);
|
EmptyValue* c = calloc(sz+getPageSize(), 1);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
#else
|
#else
|
||||||
u8* mem = MMAP(sz);
|
u8* mem = MMAP(sz);
|
||||||
|
fprintf(stderr, ": got %p\n", mem);
|
||||||
if (mem==MAP_FAILED) thrOOM();
|
if (mem==MAP_FAILED) thrOOM();
|
||||||
if (ptr2u64(mem)+sz > (1ULL<<48)) err("mmap returned address range above 2⋆48");
|
if (ptr2u64(mem)+sz > (1ULL<<48)) err("mmap returned address range above 2⋆48");
|
||||||
#if ALLOC_MODE==0
|
#if ALLOC_MODE==0
|
||||||
@ -80,9 +85,6 @@ static NOINLINE void* BN(allocateMore)(i64 bucket, u8 type, i64 from, i64 to) {
|
|||||||
#endif
|
#endif
|
||||||
mm_heapAlloc+= sz;
|
mm_heapAlloc+= sz;
|
||||||
|
|
||||||
#if LOG_GC || LOG_MM_MORE
|
|
||||||
fprintf(stderr, "allocating "N64u" more " str1(BN()) " heap (from allocation of "N64u"B/bucket %d)\n", sz, (u64)BSZ(bucket), (int)bucket);
|
|
||||||
#endif
|
|
||||||
if (alSize+1>=alCap) {
|
if (alSize+1>=alCap) {
|
||||||
alCap = alCap? alCap*2 : 1024;
|
alCap = alCap? alCap*2 : 1024;
|
||||||
al = realloc(al, sizeof(AllocInfo)*alCap);
|
al = realloc(al, sizeof(AllocInfo)*alCap);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user