See the gcc documentation about function attribute noinline for details.
Hope to fix hangs seen with optimized builds on recent Alpine/Linux.
Let's see also if it works as is with all supported compilers.
SIMGRID_REGISTER_PLUGIN(id,desc,init)= \
XBT_PUBLIC= \
XBT_PUBLIC_DATA=extern \
- XBT_PUBLIC= \
- XBT_INLINE= \
- XBT_ALWAYS_INLINE= \
XBT_PRIVATE= \
+ XBT_ALWAYS_INLINE= \
+ XBT_ATTRIB_NOINLINE= \
XBT_ATTRIB_NORETURN= \
XBT_ATTRIB_UNUSED= \
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname,parent,desc)= \
# define XBT_ATTRIB_DESTRUCTOR(prio) __attribute__((__destructor__))
#endif
+#define XBT_ATTRIB_NOINLINE __attribute__((noinline))
+
#if defined(__GNUC__)
#define XBT_ALWAYS_INLINE inline __attribute__((always_inline))
#else
*/
static void xbt_preinit() XBT_ATTRIB_CONSTRUCTOR(200);
static void xbt_postexit();
-void sthread_enable()
+XBT_ATTRIB_NOINLINE void sthread_enable()
{ // These symbols are used from ContextSwapped in any case, but they are only useful
+ asm("");
}
-void sthread_disable()
+XBT_ATTRIB_NOINLINE void sthread_disable()
{ // when libsthread is LD_PRELOADED. In this case, sthread's implem gets used instead.
+ asm("");
}
static void xbt_preinit()