Skip to content

Commit

Permalink
Redirect malloc_size() and _msize() in leak_detector.h
Browse files Browse the repository at this point in the history
Issue #644 (bdwgc).

* include/gc/leak_detector.h (malloc_usable_size): Add comment.
* include/gc/leak_detector.h (malloc_size, _msize): Redefine macro (to
GC_size).
  • Loading branch information
ivmai committed Jun 3, 2024
1 parent b54d7cc commit 8915b63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/gc/leak_detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@
# define pvalloc(n) GC_pvalloc(n) /* obsolete */
#endif /* !GC_NO_VALLOC */

#undef malloc_usable_size
#undef malloc_usable_size /* available in glibc */
#define malloc_usable_size(p) GC_size(p)
#undef malloc_size /* available on Darwin */
#define malloc_size(p) GC_size(p)
#undef _msize /* available in Windows CRT */
#define _msize(p) GC_size(p)

#ifndef CHECK_LEAKS
# define CHECK_LEAKS() GC_gcollect()
Expand Down

0 comments on commit 8915b63

Please sign in to comment.