[libc-commits] [PATCH] D148290: Support custom attributes in pthread_create
Noah Goldstein via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon May 22 10:54:05 PDT 2023
goldstein.w.n added inline comments.
================
Comment at: libc/src/__support/threads/linux/thread.cpp:493
+ // TODO: We may have deallocated the stack. Can we reference local variables
+ // that may have spilled?
if (style == ThreadStyle::POSIX)
----------------
sivachandra wrote:
> goldstein.w.n wrote:
> > sivachandra wrote:
> > > This is a good catch! What do you think of just exiting with a return code of say -1 if the thread is detached? We can take this up separately.
> > Won't that be a massive memory leak?
> >
> > Although its not super clear how to handle this w.o some degree of inline-assembly.
> >
> What I mean is, just add
>
> ```
> __llvm_libc::syscall_impl(SYS_exit, -1);
> ```
>
> after line 489 but before the end of the scope.
Ahh, makes sense. I'll create follow up for that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148290/new/
https://reviews.llvm.org/D148290
More information about the libc-commits
mailing list