]> granicus.if.org Git - gc/commit
HOTFIX: Remove locking in API GC_get_bytes_since_gc and friends.
authorIvan Maidanski <ivmai@mail.ru>
Wed, 7 Sep 2011 13:35:22 +0000 (17:35 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 7 Sep 2011 13:35:22 +0000 (17:35 +0400)
commit42a4604b303e9c8fda523cd553cd6db34bfbbf0c
tree7860fe6bcc3a948afa12d4897701fe1b3eb9e612
parent9178d45a3a71525de17c20a6b6110eb84b8e6332
HOTFIX: Remove locking in API GC_get_bytes_since_gc and friends.
Add GC_get_heap_usage_safe() to API as a thread-safe alternative to
GC_get_bytes_since_gc and friends.
Remove newly-added lock-free GC_get_heap_size_inner and
GC_get_free_bytes_inner from API.

* include/gc.h (GC_get_heap_size, GC_get_free_bytes,
GC_get_unmapped_bytes, GC_get_bytes_since_gc, GC_get_total_bytes):
Refine comment.
* include/gc.h (GC_HAVE_GET_HEAP_USAGE_SAFE): New macro.
* include/gc.h (GC_get_heap_usage_safe): New API function.
* misc.c (GC_get_heap_usage_safe): Likewise.
* include/gc_mark.h (GC_get_heap_size_inner, GC_get_free_bytes_inner):
Remove API function.
* misc.c (GC_get_heap_size_inner, GC_get_free_bytes_inner): Likewise.
* misc.c (GC_get_heap_size): Add comment.
* misc.c (GC_get_heap_size, GC_get_free_bytes, GC_get_unmapped_bytes,
GC_get_bytes_since_gc, GC_get_total_bytes): Remove locking.
* misc.c (GC_get_unmapped_bytes): Do not test USE_MUNMAP (not needed
after locking removal).
* misc.c (GC_get_bytes_since_gc, GC_get_total_bytes): Cast result to
size_t.
include/gc.h
include/gc_mark.h
misc.c