summaryrefslogtreecommitdiff
path: root/libguile/gc.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-05-26 15:53:02 +0200
committerAndy Wingo <wingo@pobox.com>2011-05-26 17:10:01 +0200
commit4cf77f094671559f7f120c7d14e4e3d0982148b1 (patch)
treea8ca745a381ee6840272f056e0d242e1bfd467d9 /libguile/gc.h
parentebc16e6a762748fc5939903a8b3a367d422f1371 (diff)
downloadguile-4cf77f094671559f7f120c7d14e4e3d0982148b1.tar.gz
simplify inline function infrastructure
* libguile/__scm.h (SCM_C_EXTERN_INLINE): Move this definition here, from inline.h. We'd like to support inline function definitions in more header files: not just inline.h. (SCM_CAN_INLINE, SCM_INLINE, SCM_INLINE_IMPLEMENTATION): New definitions. * libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Define these wrappers, which redirect to the GC_MALLOC macros when building Guile, and the scm_gc_malloc functions otherwise. A step towards getting BDW-GC out of Guile's API. * libguile/inline.h: Simplify, using SCM_INLINE, SCM_INLINE_IMPLEMENTATION, and SCM_IMPLEMENT_INLINES. Also use the new SCM_GC_MALLOC macros.
Diffstat (limited to 'libguile/gc.h')
-rw-r--r--libguile/gc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libguile/gc.h b/libguile/gc.h
index 2e2fc1fa2..0aed27687 100644
--- a/libguile/gc.h
+++ b/libguile/gc.h
@@ -191,6 +191,17 @@ SCM_API char *scm_gc_strdup (const char *str, const char *what)
SCM_API char *scm_gc_strndup (const char *str, size_t n, const char *what)
SCM_MALLOC;
+
+#ifdef BUILDING_LIBGUILE
+#include "libguile/bdw-gc.h"
+#define SCM_GC_MALLOC(size) GC_MALLOC (size)
+#define SCM_GC_MALLOC_POINTERLESS(size) GC_MALLOC_ATOMIC (size)
+#else
+#define SCM_GC_MALLOC(size) scm_gc_malloc (size, NULL)
+#define SCM_GC_MALLOC_POINTERLESS(size) scm_gc_malloc_pointerless (size, NULL)
+#endif
+
+
SCM_API void scm_remember_upto_here_1 (SCM obj);
SCM_API void scm_remember_upto_here_2 (SCM obj1, SCM obj2);
SCM_API void scm_remember_upto_here (SCM obj1, ...);