[Gc] Re[3]: GC_is_disabled returns false when GC_enable() is called too many times

Ivan Maidanski ivmai at mail.ru
Sun Dec 9 06:51:04 PST 2012


Hi Kjetil,

According to the current design, GC_disable/enable usage is as:

GC_disable();
/// do something critical
GC_enable();

Thus unbalanced disable/enable should be a client bug.

What are you reason to request a change?

Regards,
Ivan

9 Dec 2012, 14:55 Kjetil Matheussen <k.s.matheussen at notam02.no>:
>	
>
>
	
	
>
		
		
			
>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?
>

>

>
_______________________________________________
>
Gc mailing list
>
>Gc at linux.hpl.hp.com
>
>http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>
>			
		
		
	

	
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20121209/5f3d47ad/attachment-0001.htm


More information about the Gc mailing list