Fix new changes to runtime for unix

This commit is contained in:
gingerBill
2019-12-31 14:04:19 +00:00
parent 5a50ab7a99
commit c407687a4c
2 changed files with 14 additions and 11 deletions

View File

@@ -1,8 +1,9 @@
//+build !windows !amd64
//+build !windows
package runtime
@(link_name="memset")
memset :: proc "c" (ptr: rawptr, val: i32, len: int) -> rawptr {
when false {
b := byte(val);
p_start := uintptr(ptr);
@@ -12,13 +13,15 @@ memset :: proc "c" (ptr: rawptr, val: i32, len: int) -> rawptr {
}
return ptr;
// when size_of(rawptr) == 8 {
// @(link_name="llvm.memset.p0i8.i64")
// llvm_memset :: proc(dst: rawptr, val: byte, len: int, align: i32, is_volatile: bool) ---;
// } else {
// @(link_name="llvm.memset.p0i8.i32")
// llvm_memset :: proc(dst: rawptr, val: byte, len: int, align: i32, is_volatile: bool) ---;
// }
} else {
when size_of(rawptr) == 8 {
@(link_name="llvm.memset.p0i8.i64")
llvm_memset :: proc(dst: rawptr, val: byte, len: int, align: i32, is_volatile: bool) ---;
} else {
@(link_name="llvm.memset.p0i8.i32")
llvm_memset :: proc(dst: rawptr, val: byte, len: int, align: i32, is_volatile: bool) ---;
}
// return llvm_memset(ptr, byte(val), len, 1, false);
return llvm_memset(ptr, byte(val), len, 1, false);
}
}

View File

@@ -65,8 +65,8 @@ create :: proc(procedure: Thread_Proc, priority := Thread_Priority.Normal) -> ^T
t.procedure(t);
if !t.use_init_context {
if context.temp_allocator.data == &runtime.global_scratch_allocator_data {
runtime.global_scratch_allocator_destroy(auto_cast context.temp_allocator.data);
if context.temp_allocator.data == &runtime.global_default_temp_allocator_data {
runtime.default_temp_allocator_destroy(auto_cast context.temp_allocator.data);
}
}