From b85001ea7ced0ea4b7326514c7b7fcfc33dfd0e0 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Mon, 29 Nov 2004 15:52:11 +0000 Subject: [PATCH] Functions for allocating uncollectable, but scanned memory. --- src/c/alloc_2.d | 12 ++++++++++++ src/h/external.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/c/alloc_2.d b/src/c/alloc_2.d index 9b9238016..ff8c35090 100644 --- a/src/c/alloc_2.d +++ b/src/c/alloc_2.d @@ -131,6 +131,18 @@ cl_alloc_instance(cl_index slots) return i; } +void * +ecl_alloc_uncollectable(size_t size) +{ + return GC_MALLOC_UNCOLLECTABLE(size); +} + +void +ecl_free_uncollectable(void *pointer) +{ + return GC_FREE(pointer); +} + static void init_tm(cl_type t, const char *name, cl_index elsize) { diff --git a/src/h/external.h b/src/h/external.h index ebd89859b..520c09a3c 100644 --- a/src/h/external.h +++ b/src/h/external.h @@ -204,6 +204,8 @@ extern cl_object si_set_hole_size _ARGS((cl_narg narg, cl_object size)); extern cl_object si_ignore_maximum_pages _ARGS((cl_narg narg, ...)); extern void *cl_alloc(cl_index n); extern void *cl_alloc_align(cl_index size, cl_index align); +extern void *ecl_alloc_uncollectable(size_t size); +extern void ecl_free_uncollectable(void *); #define cl_alloc_atomic(x) cl_alloc(x) #define cl_alloc_atomic_align(x,s) cl_alloc_align(x,s) #define ecl_register_static_root(x) ecl_register_root(x);