mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
std.Thread: fix freeAndExit on x86_64-linux (#12693)
Previously, this function used incorrect registers for the munmap syscall, leading to detached threads not cleaning up. closes #12690 Co-authored-by: bxlr <biexelar@diroot.org>
This commit is contained in:
+2
-5
@@ -769,16 +769,13 @@ const LinuxThreadImpl = struct {
|
|||||||
),
|
),
|
||||||
.x86_64 => asm volatile (
|
.x86_64 => asm volatile (
|
||||||
\\ movq $11, %%rax
|
\\ movq $11, %%rax
|
||||||
\\ movq %[ptr], %%rbx
|
|
||||||
\\ movq %[len], %%rcx
|
|
||||||
\\ syscall
|
\\ syscall
|
||||||
\\ movq $60, %%rax
|
\\ movq $60, %%rax
|
||||||
\\ movq $1, %%rdi
|
\\ movq $1, %%rdi
|
||||||
\\ syscall
|
\\ syscall
|
||||||
:
|
:
|
||||||
: [ptr] "r" (@ptrToInt(self.mapped.ptr)),
|
: [ptr] "{rdi}" (@ptrToInt(self.mapped.ptr)),
|
||||||
[len] "r" (self.mapped.len),
|
[len] "{rsi}" (self.mapped.len),
|
||||||
: "memory"
|
|
||||||
),
|
),
|
||||||
.arm, .armeb, .thumb, .thumbeb => asm volatile (
|
.arm, .armeb, .thumb, .thumbeb => asm volatile (
|
||||||
\\ mov r7, #91
|
\\ mov r7, #91
|
||||||
|
|||||||
Reference in New Issue
Block a user