summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-02-01 18:25:44 +0100
committerIvan Maidanski <ivmai@mail.ru>2012-02-03 17:38:19 +0100
commit1a1d3508479036e7446bbf4818dba876eedc3348 (patch)
tree569b2f336f3fd5ba7d6502fe78a375d35f6a3876 /include
parent320d5bc7df468202b3dc823d21142c2374e04e2d (diff)
Add GC_is_disabled new function to GC API
* include/gc.h (GC_dont_gc): Improve comment (add note for new client code). * include/gc.h (GC_is_disabled): New API function. * misc.c (GC_is_disabled): Likewise.
Diffstat (limited to 'include')
-rw-r--r--include/gc.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/gc.h b/include/gc.h
index f460a63..dfa0ff6 100644
--- a/include/gc.h
+++ b/include/gc.h
@@ -181,9 +181,10 @@ GC_API int GC_dont_gc; /* != 0 ==> Don't collect. In versions 6.2a1+, */
/* Used as a counter, so that nested enabling */
/* and disabling work correctly. Should */
/* normally be updated with GC_enable() and */
- /* GC_disable() calls. */
- /* Direct assignment to GC_dont_gc is */
- /* deprecated. */
+ /* GC_disable() calls. Direct assignment to */
+ /* GC_dont_gc is deprecated. To check whether */
+ /* GC is disabled, GC_is_disabled() is */
+ /* preferred for new code. */
GC_API int GC_dont_expand;
/* Don't expand the heap unless explicitly */
@@ -570,6 +571,10 @@ GC_API void GC_CALL GC_get_heap_usage_safe(GC_word * /* pheap_size */,
/* ineffective. */
GC_API void GC_CALL GC_disable(void);
+/* Return non-zero (TRUE) if and only if garbage collection is disabled */
+/* (i.e., GC_dont_gc value is non-zero). Does not acquire the lock. */
+GC_API int GC_CALL GC_is_disabled(void);
+
/* Re-enable garbage collection. GC_disable() and GC_enable() calls */
/* nest. Garbage collection is enabled if the number of calls to both */
/* both functions is equal. */