diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2014-04-23 01:28:32 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2014-04-23 01:28:32 +0400 |
commit | 36aa13da6c202b354537c08fa909f7bf122b420f (patch) | |
tree | e9a1ddfb70f1e7959c0a6786d5025dfebf4c3b7f /thread_local_alloc.c | |
parent | 991ec30cfbfbfa7440aef32cb354d2d295cb9ac4 (diff) | |
download | bdwgc-36aa13da6c202b354537c08fa909f7bf122b420f.tar.gz |
Fix MS VC redefinition warning for functions declared with GC_ATTR_MALLOC
* dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
GC_debug_malloc_atomic_ignore_off_page, GC_debug_malloc_stubborn,
GC_debug_malloc_atomic, GC_debug_strdup, GC_debug_strndup,
GC_debug_wcsdup, GC_debug_malloc_uncollectable,
GC_debug_malloc_atomic_uncollectable,
GC_debug_generic_or_special_malloc, GC_debug_malloc_replacement): Add
GC_ATTR_MALLOC attribute to API function definition (to avoid MS VC
warning about redefinition of a symbol previously declared with
__declspec).
* fnlz_mlc.c (GC_finalized_malloc): Likewise.
* gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc,
GC_gcj_malloc_ignore_off_page): Likewise.
* malloc.c (GC_generic_malloc, GC_malloc_atomic, GC_malloc,
GC_malloc_uncollectable): Likewise.
* mallocx.c (GC_generic_or_special_malloc,
GC_generic_malloc_ignore_off_page, GC_malloc_ignore_off_page,
GC_malloc_atomic_ignore_off_page, GC_malloc_many, GC_memalign,
GC_malloc_atomic_uncollectable, GC_strdup, GC_strndup, GC_wcsdup):
Likewise.
* stubborn.c (GC_malloc_stubborn): Likewise.
* thread_local_alloc.c (GC_malloc, GC_malloc_atomic, GC_gcj_malloc):
Likewise.
* typd_mlc.c (GC_malloc_explicitly_typed,
GC_malloc_explicitly_typed_ignore_off_page,
GC_calloc_explicitly_typed): Likewise.
Diffstat (limited to 'thread_local_alloc.c')
-rw-r--r-- | thread_local_alloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/thread_local_alloc.c b/thread_local_alloc.c index a35b0c3f..8d184f51 100644 --- a/thread_local_alloc.c +++ b/thread_local_alloc.c @@ -144,7 +144,7 @@ GC_INNER void GC_destroy_thread_local(GC_tlfs p) GC_bool GC_is_thread_tsd_valid(void *tsd); #endif -GC_API void * GC_CALL GC_malloc(size_t bytes) +GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc(size_t bytes) { size_t granules = ROUNDED_UP_GRANULES(bytes); void *tsd; @@ -181,7 +181,7 @@ GC_API void * GC_CALL GC_malloc(size_t bytes) return result; } -GC_API void * GC_CALL GC_malloc_atomic(size_t bytes) +GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_atomic(size_t bytes) { size_t granules = ROUNDED_UP_GRANULES(bytes); void *tsd; @@ -237,7 +237,7 @@ GC_API void * GC_CALL GC_malloc_atomic(size_t bytes) /* incremental GC should be enabled before we fork a second thread. */ /* Unlike the other thread local allocation calls, we assume that the */ /* collector has been explicitly initialized. */ -GC_API void * GC_CALL GC_gcj_malloc(size_t bytes, +GC_API GC_ATTR_MALLOC void * GC_CALL GC_gcj_malloc(size_t bytes, void * ptr_to_struct_containing_descr) { if (EXPECT(GC_incremental, FALSE)) { |