/* This returns a list of objects, linked through their first word. */
/* Its use can greatly reduce lock contention problems, since the */
/* allocation lock can be acquired and released many fewer times. */
-GC_API void * GC_CALL GC_malloc_many(size_t /* lb */);
+GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_many(size_t /* lb */);
#define GC_NEXT(p) (*(void * *)(p)) /* Retrieve the next element */
/* in returned list. */
/* dedicated object kind with a disclaim procedure, and is more */
/* efficient than GC_register_finalizer and friends. */
/* GC_init_finalized_malloc must be called before using this. */
-GC_API void *GC_CALL GC_finalized_malloc(size_t /*size*/,
- const struct GC_finalizer_closure * /*fc*/);
+GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void * GC_CALL
+ GC_finalized_malloc(size_t /*size*/,
+ const struct GC_finalizer_closure * /*fc*/);
#endif
/* 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 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 */);
typedef void (GC_CALLBACK * GC_describe_type_fn)(void * /* p */,
char * /* out_buf */);
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/
+
/*
* Some simple primitives for allocation with explicit type information.
* Facilities for dynamic type inference may be added later.
/* ... */
/* T_descr = GC_make_descriptor(T_bitmap, GC_WORD_LEN(T)); */
-GC_API void * GC_CALL GC_malloc_explicitly_typed(size_t /* size_in_bytes */,
- GC_descr /* d */);
+GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void * GC_CALL
+ GC_malloc_explicitly_typed(size_t /* size_in_bytes */,
+ GC_descr /* d */);
/* Allocate an object whose layout is described by d. */
/* The resulting object MAY NOT BE PASSED TO REALLOC. */
/* The returned object is cleared. */
-GC_API void * GC_CALL GC_malloc_explicitly_typed_ignore_off_page(
- size_t /* size_in_bytes */,
- GC_descr /* d */);
+GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void * GC_CALL
+ GC_malloc_explicitly_typed_ignore_off_page(size_t /* size_in_bytes */,
+ GC_descr /* d */);
-GC_API void * GC_CALL GC_calloc_explicitly_typed(size_t /* nelements */,
- size_t /* element_size_in_bytes */,
- GC_descr /* d */);
+GC_API GC_ATTR_MALLOC void * GC_CALL
+ GC_calloc_explicitly_typed(size_t /* nelements */,
+ size_t /* element_size_in_bytes */,
+ GC_descr /* d */);
/* Allocate an array of nelements elements, each of the */
/* given size, and with the given descriptor. */
/* The element size must be a multiple of the byte */