소스 검색

Make `js` default to nil allocator for the time being

gingerBill 4 년 전
부모
커밋
39eccdf6b9
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      core/runtime/default_allocators.odin
  2. 1 1
      core/runtime/internal.odin

+ 1 - 1
core/runtime/default_allocators.odin

@@ -1,6 +1,6 @@
 package runtime
 
-when ODIN_DEFAULT_TO_NIL_ALLOCATOR || ODIN_OS == "freestanding" {
+when ODIN_DEFAULT_TO_NIL_ALLOCATOR || ODIN_OS == "freestanding" || ODIN_OS == "js" {
 	// mem.nil_allocator reimplementation
 
 	default_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,

+ 1 - 1
core/runtime/internal.odin

@@ -623,7 +623,7 @@ truncsfhf2 :: proc "c" (value: f32) -> u16 {
 		}
 
 		if (e > 30) {
-			f := 1e12;
+			f := i64(1e12);
 			for j := 0; j < 10; j += 1 {
 				/* NOTE(bill): Cause overflow */
 				g := intrinsics.volatile_load(&f);