mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 04:38:16 +00:00
Merge branch 'master' into bill/utf16-strings
This commit is contained in:
@@ -249,9 +249,9 @@ _destroy :: proc(f: ^File_Impl) -> Error {
|
||||
a := f.allocator
|
||||
err0 := free(rawptr(f.wname), a)
|
||||
err1 := delete(f.name, a)
|
||||
err2 := free(f, a)
|
||||
err3 := delete(f.r_buf, a)
|
||||
err4 := delete(f.w_buf, a)
|
||||
err2 := delete(f.r_buf, a)
|
||||
err3 := delete(f.w_buf, a)
|
||||
err4 := free(f, a)
|
||||
err0 or_return
|
||||
err1 or_return
|
||||
err2 or_return
|
||||
|
||||
@@ -103,6 +103,7 @@ context_create_with_sleep :: proc(filename: string, sleep := 2 * time.Second) ->
|
||||
|
||||
context_create :: proc{context_create_with_scale, context_create_with_sleep}
|
||||
|
||||
@(no_instrumentation)
|
||||
context_destroy :: proc(ctx: ^Context) {
|
||||
if ctx == nil {
|
||||
return
|
||||
@@ -146,6 +147,7 @@ buffer_flush :: proc "contextless" (ctx: ^Context, buffer: ^Buffer) #no_bounds_c
|
||||
buffer.first_ts = end
|
||||
}
|
||||
|
||||
@(no_instrumentation)
|
||||
buffer_destroy :: proc(ctx: ^Context, buffer: ^Buffer) {
|
||||
buffer_flush(ctx, buffer)
|
||||
|
||||
@@ -155,12 +157,14 @@ buffer_destroy :: proc(ctx: ^Context, buffer: ^Buffer) {
|
||||
|
||||
|
||||
@(deferred_in=_scoped_buffer_end)
|
||||
@(no_instrumentation)
|
||||
SCOPED_EVENT :: proc(ctx: ^Context, buffer: ^Buffer, name: string, args: string = "", location := #caller_location) -> bool {
|
||||
_buffer_begin(ctx, buffer, name, args, location)
|
||||
return true
|
||||
}
|
||||
|
||||
@(private)
|
||||
@(no_instrumentation)
|
||||
_scoped_buffer_end :: proc(ctx: ^Context, buffer: ^Buffer, _, _: string, _ := #caller_location) {
|
||||
_buffer_end(ctx, buffer)
|
||||
}
|
||||
|
||||
@@ -81,8 +81,13 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
|
||||
}
|
||||
defer posix.pthread_attr_destroy(&attrs)
|
||||
|
||||
// NOTE(tetra, 2019-11-01): These only fail if their argument is invalid.
|
||||
stacksize: posix.rlimit
|
||||
if res := posix.getrlimit(.STACK, &stacksize); res == .OK && stacksize.rlim_cur > 0 {
|
||||
_ = posix.pthread_attr_setstacksize(&attrs, uint(stacksize.rlim_cur))
|
||||
}
|
||||
|
||||
res: posix.Errno
|
||||
// NOTE(tetra, 2019-11-01): These only fail if their argument is invalid.
|
||||
res = posix.pthread_attr_setdetachstate(&attrs, .CREATE_JOINABLE)
|
||||
assert(res == nil)
|
||||
when ODIN_OS != .Haiku && ODIN_OS != .NetBSD {
|
||||
|
||||
Reference in New Issue
Block a user