diff --git a/bin/ikarus b/bin/ikarus index 6ccad4e..d4b1fd7 100755 Binary files a/bin/ikarus and b/bin/ikarus differ diff --git a/bin/ikarus-collect.c b/bin/ikarus-collect.c index 49ec8f5..70966ab 100644 --- a/bin/ikarus-collect.c +++ b/bin/ikarus-collect.c @@ -376,7 +376,6 @@ ik_collect(int mem_req, ikpcb* pcb){ add_to_collect_count(pcb, bytes); } - struct rusage t0, t1; struct timeval rt0, rt1; gettimeofday(&rt0, 0); @@ -496,11 +495,13 @@ ik_collect(int mem_req, ikpcb* pcb){ int free_space = ((unsigned int)pcb->allocation_redline) - ((unsigned int)pcb->allocation_pointer); - if(free_space <= mem_req){ + #define HEAPSIZE (1024 * 4096) + if((free_space <= mem_req) || (pcb->heap_size < HEAPSIZE)){ #ifndef NDEBUG fprintf(stderr, "REQ=%d, got %d\n", mem_req, free_space); #endif - int memsize = align_to_next_page(mem_req); + int memsize = (mem_req>HEAPSIZE) ? mem_req : HEAPSIZE; + memsize = align_to_next_page(memsize); ik_munmap_from_segment( pcb->heap_base, pcb->heap_size, diff --git a/bin/ikarus-runtime.c b/bin/ikarus-runtime.c index 2b95a38..dbc08a8 100644 --- a/bin/ikarus-runtime.c +++ b/bin/ikarus-runtime.c @@ -457,7 +457,6 @@ char* ik_uuid(char* str){ static const char* uuid_chars = "!$%&/0123456789<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static int uuid_strlen = 1; - ikp ik_uuid(ikp str){ static int fd = -1; if(fd == -1){ diff --git a/src/ikarus.boot b/src/ikarus.boot index d89ba36..b0a1af2 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.fixnums.ss b/src/ikarus.fixnums.ss index 338439d..01d3c2f 100644 --- a/src/ikarus.fixnums.ss +++ b/src/ikarus.fixnums.ss @@ -250,7 +250,9 @@ (error 'fxarithmetic-shift "~s is not a fixnum" y)) (if ($fx>= y 0) ($fxsll x y) - ($fxsra x ($fx- 0 y))))) + (if ($fx< x -100) ;;; arbitrary number < (fixnum-width) + ($fxsra x 32) + ($fxsra x ($fx- 0 y)))))) (define (fxpositive? x) (if (fixnum? x) diff --git a/src/ikarus.singular-objects.ss b/src/ikarus.singular-objects.ss index 861af9c..01890da 100644 --- a/src/ikarus.singular-objects.ss +++ b/src/ikarus.singular-objects.ss @@ -1,13 +1,15 @@ (library (ikarus singular-objects) - (export base-rtd eof-object void) + (export base-rtd eof-object void #;fixnum-width) (import (rename (ikarus system $records) (base-rtd sys:base-rtd)) (rename (ikarus) (void sys:void) + #; (fixnum-width sys:fixnum-width) (eof-object sys:eof-object))) (define (void) (sys:void)) +#; (define (fixnum-width) (sys:fixnum-width)) (define (eof-object) (sys:eof-object)) (define (base-rtd) (sys:base-rtd))) diff --git a/src/makefile.ss b/src/makefile.ss index 6a605cb..2cc1f32 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -459,6 +459,7 @@ [fxarithmetic-shift i] [fxmin i] [fxmax i] + [fixnum-width i] [for-each i r] [map i r] diff --git a/src/pass-specify-rep-primops.ss b/src/pass-specify-rep-primops.ss index 2359371..85d4125 100644 --- a/src/pass-specify-rep-primops.ss +++ b/src/pass-specify-rep-primops.ss @@ -545,6 +545,15 @@ [(P x) (tag-test (T x) fixnum-mask fixnum-tag)] [(E x) (nop)]) +;(define-primop foo safe +; [(V) (K 0)]) + +;(define-primop fixnum-width safe +; [(V) (K 0)] ;(K (fxsll (- (* wordsize 8) fx-shift) fx-shift))] +; ;[(E) (nop)] +; ;[(P) (K #t)] +; ) + (define-primop $fxzero? unsafe [(P x) (prm '= (T x) (K 0))] [(E x) (nop)]) diff --git a/src/pass-specify-rep.ss b/src/pass-specify-rep.ss index b3def2c..4507903 100644 --- a/src/pass-specify-rep.ss +++ b/src/pass-specify-rep.ss @@ -18,7 +18,6 @@ (define fixnum-mask 3)) (module primops (primop? get-primop set-primop!) - (define cookie (gensym)) (define (primop? x) (and (getprop x cookie) #t))