struct disappearing_link * new_dl;
DCL_LOCK_STATE;
+ if (EXPECT(GC_find_leak, FALSE)) return GC_UNIMPLEMENTED;
LOCK();
GC_ASSERT(obj != NULL && GC_base_C(obj) == obj);
if (dl_hashtbl -> log_size == -1
hdr *hhdr = NULL; /* initialized to prevent warning. */
DCL_LOCK_STATE;
+ if (EXPECT(GC_find_leak, FALSE)) return;
LOCK();
if (log_fo_table_size == -1
|| GC_fo_entries > ((word)1 << log_fo_table_size)) {
#endif
GC_API GC_ATTR_DEPRECATED int GC_find_leak;
- /* Do not actually garbage collect, but simply */
+ /* Set to true to turn on the leak-finding mode */
+ /* (do not actually garbage collect, but simply */
/* report inaccessible memory that was not */
- /* deallocated with GC_free. Initial value */
+ /* deallocated with GC_FREE). Initial value */
/* is determined by FIND_LEAK macro. */
/* The value should not typically be modified */
/* after GC initialization (and, thus, it does */
/* be avoided, or broken by disappearing links. */
/* All but the last finalizer registered for an object */
/* is ignored. */
+ /* No-op in the leak-finding mode. */
/* Finalization may be removed by passing 0 as fn. */
/* Finalizers are implicitly unregistered when they are */
/* enqueued for finalization (i.e. become ready to be */
/* explicitly deallocate the object containing link. */
/* Explicit deallocation of obj may or may not cause */
/* link to eventually be cleared. */
+ /* No-op in the leak-finding mode. */
/* This function can be used to implement certain types */
/* of weak pointers. Note, however, this generally */
/* requires that the allocation lock is held (see */
/* succeeded (a new link is registered), GC_DUPLICATE */
/* if link was already registered (with some object), */
/* GC_NO_MEMORY if registration failed for lack of */
- /* memory (and GC_oom_fn did not handle the problem). */
+ /* memory (and GC_oom_fn did not handle the problem), */
+ /* GC_UNIMPLEMENTED if GC_find_leak is true. */
GC_API int GC_CALL GC_move_disappearing_link(void ** /* link */,
void ** /* new_link */)