diff --git a/lib.nas b/lib.nas index 68c97ec..5daf404 100644 --- a/lib.nas +++ b/lib.nas @@ -263,23 +263,6 @@ var math= isnan: func(x) {return __builtin_isnan(x); } }; -var D2R=math.pi/180; -var FPS2KT=0.5925; -var FT2M=0.3048; -var GAL2L=3.7854; -var IN2M=0.0254; -var KG2LB=2.2046; -var KT2FPS=1.6878; -var KT2MPS=0.5144; -var L2GAL=0.2642; -var LB2KG=0.4536; -var M2FT=3.2808; -var M2IN=39.3701; -var M2NM=0.00054; -var MPS2KT=1.9438; -var NM2M=1852; -var R2D=180/math.pi; - var unix= { pipe: func(){die("not supported yet");}, @@ -327,4 +310,22 @@ var runtime= # do garbage collection manually. # carefully use it because using it frequently may make program running slower. gc: func(){return __builtin_gc;} -}; \ No newline at end of file +}; + +# important global constants +var D2R=math.pi/180; +var FPS2KT=0.5925; +var FT2M=0.3048; +var GAL2L=3.7854; +var IN2M=0.0254; +var KG2LB=2.2046; +var KT2FPS=1.6878; +var KT2MPS=0.5144; +var L2GAL=0.2642; +var LB2KG=0.4536; +var M2FT=3.2808; +var M2IN=39.3701; +var M2NM=0.00054; +var MPS2KT=1.9438; +var NM2M=1852; +var R2D=180/math.pi; \ No newline at end of file diff --git a/makefile b/makefile index 648db94..d65347d 100644 --- a/makefile +++ b/makefile @@ -20,7 +20,7 @@ test:nasal ./nasal -op -e -d test/lexer.nas ./nasal -op -e -d test/life.nas ./nasal -op -t test/loop.nas - ./nasal -op -c test/mandel.nas + ./nasal -op -t -d test/mandel.nas ./nasal -op -t -d test/mandelbrot.nas ./nasal -op -c test/module_test.nas ./nasal -op -e test/nasal_test.nas diff --git a/nasal_gc.h b/nasal_gc.h index bc141fb..552f93a 100644 --- a/nasal_gc.h +++ b/nasal_gc.h @@ -322,7 +322,7 @@ struct nasal_gc std::vector memory; // gc memory std::queue free_list[vm_type_size]; // gc free list std::vector local; - size_t size[vm_type_size]; + uint64_t size[vm_type_size]; uint64_t count[vm_type_size]; void mark(); void sweep(); @@ -390,10 +390,7 @@ void nasal_gc::sweep() void nasal_gc::init(const std::vector& s) { for(uint8_t i=0;i