mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd::ctx: Move macro condition to internal header.
This commit is contained in:
parent
de94e95422
commit
be0fad506e
2 changed files with 10 additions and 10 deletions
10
ircd/ctx.cc
10
ircd/ctx.cc
|
@ -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)
|
||||
|
|
10
ircd/ctx.h
10
ircd/ctx.h
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue