Assert not going through the PAL (#140)

* Assert not going through the PAL

* Make it more difficult to assert() accidentally
This commit is contained in:
Amaury Chamayou
2020-03-11 15:58:44 +00:00
committed by GitHub
parent 3911e2c4b5
commit 8e3efcb1dc
5 changed files with 6 additions and 4 deletions

View File

@@ -2,7 +2,6 @@
#include "../pal/pal_consts.h"
#include "bits.h"
#include <cassert>
#include <cstdint>
namespace snmalloc

View File

@@ -9,7 +9,6 @@
#include "defines.h"
#include <atomic>
#include <cassert>
#include <cstdint>
#include <type_traits>
#if defined(_WIN32) && defined(__GNUC__)

View File

@@ -1,6 +1,5 @@
#pragma once
#include <cassert>
#include <cstdint>
#include <type_traits>

View File

@@ -1283,7 +1283,7 @@ namespace snmalloc
SNMALLOC_SLOW_PATH void
remote_dealloc_slow(RemoteAllocator* target, void* p, sizeclass_t sizeclass)
{
assert(target->id() != id());
SNMALLOC_ASSERT(target->id() != id());
// Now that we've established that we're in the slow path (if we're a
// real allocator, we will have to empty our cache now), check if we are

View File

@@ -5,6 +5,11 @@
#include <iostream>
#include <snmalloc.h>
#ifdef assert
# undef assert
#endif
#define assert please_use_SNMALLOC_ASSERT
void* oe_base;
void* oe_end;
extern "C" const void* __oe_get_heap_base()