[Gc] Re: GC_is_disabled returns false when GC_enable() is called too many times.
Kjetil Matheussen
k.s.matheussen at notam02.no
Sun Dec 9 05:55:02 PST 2012
On 09.12.2012 14:24, Kjetil Matheussen wrote:
> On 09.12.2012 14:21, Kjetil Matheussen wrote:
>> ...which is quite confusing. Perhaps GC_is_disabled should be
>> changed
>> like this?
>>
>>
>> [kjetil at ttlush gc-7.2]$ diff -u misc_bu.c misc.c
>> --- misc_bu.c 2012-12-09 14:18:53.185065422 +0100
>> +++ misc.c 2012-12-09 14:20:33.955746560 +0100
>> @@ -1472,7 +1472,7 @@
>>
>> GC_API int GC_CALL GC_is_disabled(void)
>> {
>> - return GC_dont_gc != 0;
>> + return GC_dont_gc >= 0;
>> }
>>
>> /* Helper procedures for new kind creation. */
>
>
> Ouch. I ment:
>
>
> [kjetil at ttlush gc-7.2]$ diff -u misc_bu.c misc.c
> --- misc_bu.c 2012-12-09 14:18:53.185065422 +0100
> +++ misc.c 2012-12-09 14:23:55.108103240 +0100
> @@ -1472,7 +1472,7 @@
>
> GC_API int GC_CALL GC_is_disabled(void)
> {
> - return GC_dont_gc != 0;
> + return GC_dont_gc > 0;
> }
>
> /* Helper procedures for new kind creation. */
>
Hmm, I see now that the current behaviour is
correct according to documentation, and that this would
be an API change. Sorry for the noise.
Perhaps the API for enable/disable should be changed in the next
major version?
More information about the Gc
mailing list