summaryrefslogtreecommitdiff
path: root/include/new_gc_alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/new_gc_alloc.h')
-rw-r--r--include/new_gc_alloc.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/new_gc_alloc.h b/include/new_gc_alloc.h
index 54b7bd4..1187f0b 100644
--- a/include/new_gc_alloc.h
+++ b/include/new_gc_alloc.h
@@ -20,9 +20,9 @@
// It also doesn't yet understand the new header file names or
// namespaces.
//
-// This assumes the collector has been compiled with -DATOMIC_UNCOLLECTABLE
-// and -DALL_INTERIOR_POINTERS. We also recommend
-// -DREDIRECT_MALLOC=GC_uncollectable_malloc.
+// This assumes the collector has been compiled with -DATOMIC_UNCOLLECTABLE.
+// The user should also consider -DREDIRECT_MALLOC=GC_uncollectable_malloc,
+// to ensure that object allocated through malloc are traced.
//
// Some of this could be faster in the explicit deallocation case.
// In particular, we spend too much time clearing objects on the
@@ -43,11 +43,14 @@
// problems. The argument for changing it is that the usual default
// allocator is usually a very bad choice for a garbage collected environment.)
//
+// This code assumes that the collector itself has been compiled with a
+// compiler that defines __STDC__ .
+//
#ifndef GC_ALLOC_H
#include "gc.h"
-#include <alloc.h>
+#include <stack> // A more portable way to get stl_alloc.h .
#define GC_ALLOC_H
@@ -337,6 +340,8 @@ public: \
{ alloc::ptr_free_deallocate(p, sizeof (T)); } \
};
+__STL_BEGIN_NAMESPACE
+
__GC_SPECIALIZE(char, gc_alloc)
__GC_SPECIALIZE(int, gc_alloc)
__GC_SPECIALIZE(unsigned, gc_alloc)
@@ -361,6 +366,8 @@ __GC_SPECIALIZE(unsigned, single_client_traceable_alloc)
__GC_SPECIALIZE(float, single_client_traceable_alloc)
__GC_SPECIALIZE(double, single_client_traceable_alloc)
+__STL_END_NAMESPACE
+
#ifdef __STL_USE_STD_ALLOCATORS
__STL_BEGIN_NAMESPACE