[PATCH] D60039: Fix the bug of garbage collection of siod.

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 7 18:42:57 PDT 2019


LuoYuanke marked an inline comment as done.
LuoYuanke added inline comments.


================
Comment at: MultiSource/Applications/siod/slib.c:1273
     ++heap;}
+#if defined(linux)
+ // On linux, some register is mangled in jmp buffer, so object that
----------------
MaskRay wrote:
> LuoYuanke wrote:
> > MaskRay wrote:
> > > `#ifdef __GLIBC__`
> > > 
> > > musl doesn't mangle RIP,RSP,RBP.
> > Thank you for the hint. But I don't find macro__GLIBC__ with "cpp -dM". Is __GLIBC__ an internal macro of compiler? 
> > I assume on linux getcontext() is supported, so whenever getcontext() is supported we can use it.
> > So how about just fix the comments to tell developer on glibc (instead of on linux) register is mangled in jmp buffer?
> > 
> glibc `stdio.h` includes `features.h` which defines `__GLIBC__`.
I think we prefer getcontext() to setjmp() whenever getcontext() is available, because getcontext() get more register values and it is more conservetive for garbage collection. Agree?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60039/new/

https://reviews.llvm.org/D60039





More information about the llvm-commits mailing list