Fix out-of-memory handling in GC_toggleref_add
authorIvan Maidanski <ivmai@mail.ru>
Tue, 25 Aug 2015 07:19:05 +0000 (10:19 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 26 Aug 2015 20:20:45 +0000 (23:20 +0300)
commit467b279de834a48f9d5ba731727f75949afa4000
treee6c48e0cbc67a26f2184a6897b3d6f565a48fe23
parenta3beea32cdf2f8a2db1653cb99c5e27757a4c80a
Fix out-of-memory handling in GC_toggleref_add

* finalize.c (ensure_toggleref_capacity): Change return type from void
to GC_bool; return FALSE on allocation failure (or desired capacity
value overflow).
* finalize.c (GC_toggleref_add): Change return type from void to int.
* include/gc.h (GC_toggleref_add): Likewise.
* finalize.c (GC_toggleref_add): Return GC_NO_MEMORY if
ensure_toggleref_capacity failed, GC_SUCCESS otherwise (including the
case of no callback).
finalize.c
include/gc.h