]> granicus.if.org Git - gc/commitdiff
Add alloc_size attribute to GC_generic_malloc
authorIvan Maidanski <ivmai@mail.ru>
Mon, 10 Mar 2014 07:20:22 +0000 (11:20 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 10 Mar 2014 07:20:22 +0000 (11:20 +0400)
* include/gc_mark.h (GC_generic_malloc,
GC_generic_malloc_ignore_off_page): Add GC_ATTR_ALLOC_SIZE attribute.

include/gc_mark.h

index 2f88f38acac8d17c09d09139e710977e2f40a3c0..56bee5833cb39014e08c014f921d75cfac1c00de 100644 (file)
@@ -193,11 +193,13 @@ GC_API unsigned GC_CALL GC_new_proc_inner(GC_mark_proc);
 /* 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 GC_ATTR_ALLOC_SIZE(1) void * GC_CALL GC_generic_malloc(
+                                                            size_t /* lb */,
+                                                            int /* knd */);
 
-GC_API GC_ATTR_MALLOC void * GC_CALL GC_generic_malloc_ignore_off_page(
-                                        size_t /* lb */, int /* k */);
+GC_API GC_ATTR_MALLOC GC_ATTR_ALLOC_SIZE(1) void * GC_CALL
+                                        GC_generic_malloc_ignore_off_page(
+                                            size_t /* lb */, int /* knd */);
                                 /* As above, but pointers to past the   */
                                 /* first page of the resulting object   */
                                 /* are ignored.                         */