From 5f051d3122fd32e72f8ea6b4b43f080766ba521d Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 6 Dec 2006 10:08:34 -0500 Subject: [PATCH] fixed memory extension bug in the collector --- bin/ikarus | Bin 54228 -> 54200 bytes bin/ikarus-collect.c | 36 ++++++++++++++++++++++++++++++++++-- bin/ikarus-runtime.c | 10 ++++------ 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/bin/ikarus b/bin/ikarus index 9e0b02cbd2a38a36f2f12883284a5a55851242b0..f1d7e9c0935f1f6094a176dd7d99e6e1773958da 100755 GIT binary patch delta 9474 zcmZu%3s_ZE_TT$(QBd?^BA_B~R30KKDhMh97x00K0^0bjd~5gu-wJrR=9$AuY-w4U znpsv_K5nMH4Ad}Z%zUNJjMFeh&betLspTV+|8JjrE;#=$zi-3u?DbxI?Y-AIcyYJK zk=-6u?|BC^=CO`3)^_8E16o;jG3M2pG0Ucn4+ePq?86gCJ~WUw@<`&mJ&l&)_*utl zsU_z}$nLQ_YCjnEp8{hm#vsW?V~BsD=6D*v*HWG(#Pi;ljKxz8Z}07oIbV!4+Gt7h zfd>J22ob|^U}uE)3vKcx%PuNxGb;IY#xz@c?xG0+ZBy6sjzJf-$CVVtGYzm zF$oK*?TV1~1|y6$;-6l>o#L$ld^=@X%l(HuFKqaL)k`h#Qt~4$n*5GT|FnigZwH0R z_d<)q1XYurvZ+!Y0+P!tRJYhpQNFACBqDz0WX&~6Nl-U0`>nCj(3NHp)>m$WbvPsP zu4=Oc(I--u=%Vj9>E995qurmnz6K5!|MdL%Gft*iikWg~8n~R}A2l{=@_WKC)X1;V zd+k;RZN-zl0%Xm$-U!h?RcHjmKetlm6B#_2);|#*d+v|jodt1sCNh9kL_=YVyCfen ztt3Cj&Ed`@eE8lA@?yjtg z^b)~}TnneZc@?Av`9$1=$x|jB7t)VV71ve01_adz%wREc{HP4fV%g+dpf=@r8XnwE z4+e%u@W)S&HT?1MY%CQHMZuwHxsS?NO`TX#EW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dnmfU&g*eskpa27NNW*-hn^$&gZ8$=sA-a`@&Sp7>J6YO*lQUKcX=4 ztFTjKVmDU#0MpKaF^qk0>e@##_6L*B&?e8pzJnVo8xPM-TrfUzG_tR1{=;WK&@gid-CjM4oY_*9`ZABxQcoyXMnmF$d zj6H46btRs$g%0!KP%LAWChiLSwyE&PHH;lMG3`R?JVtji_Kk_B)G+pwiNARce>K3i zz%w+YnlXP9SA*Wkl<@}+GwBXH9yXd2+mWJ|JUD@|BPL!7+|N{42>Fjqx-aPeHu0Be z#@iMY9}lp~PKGTn#)#WTCpJ?_*h{n-h#c+S7T{VJ-Vp-N|gBhbyT5 z8collection_id++; #ifndef NDEBUG fprintf(stderr, "ik_collect entry %d free=%d (collect gen=%d/id=%d)\n", - req, + mem_req, (unsigned int) pcb->allocation_redline - (unsigned int) pcb->allocation_pointer, gc.collect_gen, pcb->collection_id-1); @@ -368,6 +368,36 @@ ik_collect(int req, ikpcb* pcb){ pcb->collect_stime.tv_sec -= 1; } + /* delete all old heap pages */ + if(pcb->heap_pages){ + ikpages* p = pcb->heap_pages; + do{ + ikpages* next = p->next; + ik_munmap_from_segment(p->base, p->size, pcb); + ik_free(p, sizeof(ikpages)); + p=next; + } while(p); + pcb->heap_pages = 0; + } + + int free_space = + ((unsigned int)pcb->allocation_redline) - + ((unsigned int)pcb->allocation_pointer); + if(free_space <= mem_req){ +#ifndef NDEBUG + fprintf(stderr, "REQ=%d, got %d\n", mem_req, free_space); +#endif + int memsize = align_to_next_page(mem_req); + ik_munmap_from_segment( + pcb->heap_base, + pcb->heap_size, + pcb); + ikp ptr = ik_mmap_mixed(memsize+2*pagesize, pcb); + pcb->allocation_pointer = ptr; + pcb->allocation_redline = ptr+memsize; + pcb->heap_base = ptr; + pcb->heap_size = memsize+2*pagesize; + } return pcb; } @@ -734,9 +764,11 @@ add_object(gc_t* gc, ikp x, char* caller){ else if(fst == continuation_tag){ ikp top = ref(x, off_continuation_top); int size = (int) ref(x, off_continuation_size); +#ifndef NDEBUG if(size > 4096){ fprintf(stderr, "large cont size=0x%08x\n", size); } +#endif ikp next = ref(x, off_continuation_next); ikp y = gc_alloc_new_ptr(continuation_size, gen, gc) + vector_tag; ref(x, -vector_tag) = forward_ptr; diff --git a/bin/ikarus-runtime.c b/bin/ikarus-runtime.c index da40c8e..e491afd 100644 --- a/bin/ikarus-runtime.c +++ b/bin/ikarus-runtime.c @@ -318,11 +318,6 @@ ik_alloc(ikpcb* pcb, int size){ return ap; } else { - static int did_warn = 0; - if(! did_warn){ - fprintf(stderr, "Extension causes leak? %d bytes\n", size); - did_warn = 1; - } if(ap){ ikpages* p = ik_malloc(sizeof(ikpages)); p->base = pcb->heap_base; @@ -354,13 +349,16 @@ void ik_error(ikp args){ void ik_stack_overflow(ikpcb* pcb){ +#ifndef NDEBUG fprintf(stderr, "entered ik_stack_overflow pcb=0x%08x\n", (int)pcb); - +#endif set_segment_type(pcb->stack_base, pcb->stack_size, data_mt, pcb); ikp frame_base = pcb->frame_base; ikp underflow_handler = ref(frame_base, -wordsize); +#ifndef NDEBUG fprintf(stderr, "underflow_handler = 0x%08x\n", (int)underflow_handler); +#endif /* capture continuation and set it as next_k */ ikp k = ik_alloc(pcb, align(continuation_size)) + vector_tag; ref(k, -vector_tag) = continuation_tag;