Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Boost contexts: add an assert checking that we don't mix up originating context.
[simgrid.git] / src / kernel / context / context_private.hpp
1 /* Copyright (c) 2017-2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_KERNEL_CONTEXT_PRIVATE_HPP
7 #define SIMGRID_KERNEL_CONTEXT_PRIVATE_HPP
8
9 #include "src/internal_config.h"
10
11 #if HAVE_SANITIZE_ADDRESS_FIBER_SUPPORT
12 #include <sanitizer/asan_interface.h>
13 #define ASAN_ASSERT(...) xbt_assert(__VA_ARGS__)
14 #define ASAN_EVAL(expr) (expr)
15 #define ASAN_START_SWITCH(fake_stack_save, bottom, size) __sanitizer_start_switch_fiber(fake_stack_save, bottom, size)
16 #define ASAN_FINISH_SWITCH(fake_stack_save, bottom_old, size_old)                                                      \
17   __sanitizer_finish_switch_fiber(fake_stack_save, bottom_old, size_old)
18 #else
19 #define ASAN_ASSERT(expr) (void)0
20 #define ASAN_EVAL(expr) (void)0
21 #define ASAN_START_SWITCH(fake_stack_save, bottom, size) (void)0
22 #define ASAN_FINISH_SWITCH(fake_stack_save, bottom_old, size_old) (void)(fake_stack_save)
23 #endif
24
25 #endif