* include/gc_mark.h (GC_generic_malloc): Refine comment.
* include/gc_mark.h (GC_generic_malloc_ignore_off_page): Move
prototype from gc_priv.h and make it public; add GC_ATTR_MALLOC
attribute.
* include/private/gc_priv.h (GC_generic_malloc): Move comment to
gc_mark.h.
* include/private/gc_priv.h (GC_generic_malloc_ignore_off_page):
Remove GC-inner prototype.
* include/private/gc_priv.h (GC_generic_malloc_inner): Update comment.
* mallocx.c (GC_generic_malloc_ignore_off_page): Likewise.
* mallocx.c (GC_generic_malloc_ignore_off_page): Make public.
GC_API unsigned GC_CALL GC_new_proc(GC_mark_proc);
GC_API unsigned GC_CALL GC_new_proc_inner(GC_mark_proc);
-/* Allocate an object of a given kind. Note that in multithreaded */
+/* Allocate an object of a given kind. By default, there are only */
+/* a few kinds: composite (pointer-free), atomic, uncollectable, etc. */
+/* We claim it is possible for clever client code that understands the */
+/* GC internals to add more, e.g. to communicate object layout */
+/* information to the collector. Note that in the multi-threaded */
/* contexts, this is usually unsafe for kinds that have the descriptor */
/* in the object itself, since there is otherwise a window in which */
/* the descriptor is not correct. Even in the single-threaded case, */
/* we need to be sure that cleared objects on a free list don't */
/* cause a GC crash if they are accidentally traced. */
-GC_API GC_ATTR_MALLOC void * GC_CALL
- GC_generic_malloc(size_t /* lb */, int /* k */);
+GC_API GC_ATTR_MALLOC void * GC_CALL GC_generic_malloc(size_t /* lb */,
+ int /* k */);
+
+GC_API GC_ATTR_MALLOC void * GC_CALL GC_generic_malloc_ignore_off_page(
+ size_t /* lb */, int /* k */);
+ /* As above, but pointers to past the */
+ /* first page of the resulting object */
+ /* are ignored. */
typedef void (GC_CALLBACK * GC_describe_type_fn)(void * /* p */,
char * /* out_buf */);
/* collection work, if appropriate. */
/* A unit is an amount appropriate for */
/* HBLKSIZE bytes of allocation. */
-/* void * GC_generic_malloc(size_t lb, int k); */
- /* Allocate an object of the given */
- /* kind. By default, there are only */
- /* a few kinds: composite(pointerfree), */
- /* atomic, uncollectable, etc. */
- /* We claim it's possible for clever */
- /* client code that understands GC */
- /* internals to add more, e.g. to */
- /* communicate object layout info */
- /* to the collector. */
- /* The actual decl is in gc_mark.h. */
-GC_INNER void * GC_generic_malloc_ignore_off_page(size_t b, int k);
- /* As above, but pointers past the */
- /* first page of the resulting object */
- /* are ignored. */
+
GC_INNER void * GC_generic_malloc_inner(size_t lb, int k);
- /* Ditto, but I already hold lock, etc. */
+ /* Allocate an object of the given */
+ /* kind but assuming lock already held. */
GC_INNER void * GC_generic_malloc_inner_ignore_off_page(size_t lb, int k);
/* Allocate an object, where */
/* the client guarantees that there */
# undef GC_debug_realloc_replacement
# endif /* REDIRECT_REALLOC */
-
/* Allocate memory such that only pointers to near the */
/* beginning of the object are considered. */
-/* We avoid holding allocation lock while we clear memory. */
-GC_INNER void * GC_generic_malloc_ignore_off_page(size_t lb, int k)
+/* We avoid holding allocation lock while we clear the memory. */
+GC_API void * GC_CALL GC_generic_malloc_ignore_off_page(size_t lb, int k)
{
void *result;
size_t lg;