summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-04-14 09:06:56 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-04-17 12:05:53 +0300
commit9b1a6e6d32915cfc24eacd5d6b4ba68d1d74eb74 (patch)
tree82fad341d2ea59687260e1af24daa39078d58b1c /tests
parent73697fce9a9ba7ae97b4a0bf6313fa864ba5b587 (diff)
downloadbdwgc-9b1a6e6d32915cfc24eacd5d6b4ba68d1d74eb74.tar.gz
Allow gc_allocator<T> and friends to be defined in namespace boehmgc
The client should define GC_NAMESPACE_ALLOCATOR before include gc_allocator.h to have all symbols of the latter to be defined in namespace boehmgc. * docs/README.macros (GC_NAMESPACE_ALLOCATOR): Document. * include/gc/gc_allocator.h [GC_NAMESPACE_ALLOCATOR] (GC_true_type, GC_false_type, GC_type_traits, GC_DECLARE_PTRFREE, GC_selective_alloc, gc_allocator, gc_allocator_ignore_off_page, traceable_allocator): Define symbols (all) in boehmgc namespace. * tests/cpp.cc (GC_NAMESPACE_ALLOCATOR): Define macro (before include gc_allocator.h). * tests/cpp.cc (gc_allocator, gc_allocator_ignore_off_page, traceable_allocator): Using the symbol of namespace boehmgc.
Diffstat (limited to 'tests')
-rw-r--r--tests/cpp.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/cpp.cc b/tests/cpp.cc
index 0aa9d835..4d97b8e0 100644
--- a/tests/cpp.cc
+++ b/tests/cpp.cc
@@ -27,7 +27,11 @@
#include <stdlib.h>
#include <string.h>
+#define GC_NAMESPACE_ALLOCATOR
#include "gc/gc_allocator.h"
+using boehmgc::gc_allocator;
+using boehmgc::gc_allocator_ignore_off_page;
+using boehmgc::traceable_allocator;
# include "private/gcconfig.h"