0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::ctx: Move macro condition to internal header.

This commit is contained in:
Jason Volk 2019-07-11 14:04:49 -07:00
parent de94e95422
commit be0fad506e
2 changed files with 10 additions and 10 deletions

View file

@ -12,16 +12,6 @@
#include <ircd/asio.h>
#include "ctx.h"
/// We make a special use of the stack-protector canary in certain places as
/// another tool to detect corruption of a context's stack, specifically
/// during yield and resume. This use is not really to provide security; just
/// a kind of extra assertion, so we eliminate its emission during release.
#if !defined(NDEBUG) && !defined(__clang__)
#define IRCD_CTX_STACK_PROTECT __attribute__((stack_protect))
#else
#define IRCD_CTX_STACK_PROTECT
#endif
/// Instance list linkage for the list of all ctx instances.
template<>
decltype(ircd::util::instance_list<ircd::ctx::ctx>::allocator)

View file

@ -8,6 +8,16 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
/// We make a special use of the stack-protector canary in certain places as
/// another tool to detect corruption of a context's stack, specifically
/// during yield and resume. This use is not really to provide security; just
/// a kind of extra assertion, so we eliminate its emission during release.
#if !defined(NDEBUG) && !defined(__clang__)
#define IRCD_CTX_STACK_PROTECT __attribute__((stack_protect))
#else
#define IRCD_CTX_STACK_PROTECT
#endif
namespace ircd::ctx
{
struct stack;