unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Accurate count of freed cells
@ 2005-12-20 13:16 Ludovic Courtès
  2005-12-23 11:14 ` Han-Wen Nienhuys
  2006-01-18  8:39 ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Ludovic Courtès @ 2005-12-20 13:16 UTC (permalink / raw)


Hi,

The patch below fixes the way freed cells are counted in
`scm_i_sweep_card ()'.  Basically, without this patch, FREE_COUNT is
incremented regardless of whether the cell pointed to by SCMPTR was
already free or not.

Thanks,
Ludovic.


2005-12-20  Ludovic Courtès  <ludovic.courtes@laas.fr>

	* gc-card.c (scm_i_sweep_card): Only increment FREE_COUNT for
	cells that were really freed.


--- orig/libguile/gc-card.c
+++ mod/libguile/gc-card.c
@@ -255,10 +255,13 @@
 	  abort();
 	}
 
+      if (SCM_CELL_TYPE (scmptr) != scm_tc_free_cell)
+	/* Only account for cells that were really freed.  */
+	free_count ++;
+
       SCM_GC_SET_CELL_WORD (scmptr, 0, scm_tc_free_cell);	  
       SCM_SET_FREE_CELL_CDR (scmptr, PTR2SCM (*free_list));
       *free_list = scmptr;
-      free_count ++;
     }
 
   return free_count;


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Accurate count of freed cells
  2005-12-20 13:16 [PATCH] Accurate count of freed cells Ludovic Courtès
@ 2005-12-23 11:14 ` Han-Wen Nienhuys
  2006-01-03 10:10   ` Ludovic Courtès
  2006-01-18  8:39 ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Han-Wen Nienhuys @ 2005-12-23 11:14 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

In article <87y82fsybo.fsf@laas.fr>,
Ludovic Courtès <ludovic.courtes@laas.fr> wrote:
>Hi,
>
>The patch below fixes the way freed cells are counted in
>`scm_i_sweep_card ()'.  Basically, without this patch, FREE_COUNT is
>incremented regardless of whether the cell pointed to by SCMPTR was
>already free or not.

isn't it tighter (one compare less) to put a

  free_count --;

in the scm_tc_free_cell case? 





_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Accurate count of freed cells
  2005-12-23 11:14 ` Han-Wen Nienhuys
@ 2006-01-03 10:10   ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2006-01-03 10:10 UTC (permalink / raw)
  Cc: guile-devel

hanwen@byrd.xs4all.nl (Han-Wen Nienhuys) writes:

> isn't it tighter (one compare less) to put a
>
>   free_count --;
>
> in the scm_tc_free_cell case? 

Maybe.  But is it such a big deal?  ;-)

Thanks,
Ludovic.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Accurate count of freed cells
  2005-12-20 13:16 [PATCH] Accurate count of freed cells Ludovic Courtès
  2005-12-23 11:14 ` Han-Wen Nienhuys
@ 2006-01-18  8:39 ` Ludovic Courtès
  2006-01-18 10:37   ` Han-Wen Nienhuys
  1 sibling, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2006-01-18  8:39 UTC (permalink / raw)


Hi,

ludovic.courtes@laas.fr (Ludovic Courtès) writes:

> 2005-12-20  Ludovic Courtès  <ludovic.courtes@laas.fr>
>
> 	* gc-card.c (scm_i_sweep_card): Only increment FREE_COUNT for
> 	cells that were really freed.

Can someone commit this and/or comment on it?

Thanks,
Ludovic.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Accurate count of freed cells
  2006-01-18  8:39 ` Ludovic Courtès
@ 2006-01-18 10:37   ` Han-Wen Nienhuys
  2006-01-19  8:27     ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Han-Wen Nienhuys @ 2006-01-18 10:37 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

In article <87y81eszea.fsf@laas.fr>,
Ludovic Courtès <ludovic.courtes@laas.fr> wrote:
>Hi,
>
>ludovic.courtes@laas.fr (Ludovic Courtès) writes:
>
>> 2005-12-20  Ludovic Courtès  <ludovic.courtes@laas.fr>
>>
>> 	* gc-card.c (scm_i_sweep_card): Only increment FREE_COUNT for
>> 	cells that were really freed.
>
>Can someone commit this and/or comment on it?
>

See CVS.




_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Accurate count of freed cells
  2006-01-18 10:37   ` Han-Wen Nienhuys
@ 2006-01-19  8:27     ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2006-01-19  8:27 UTC (permalink / raw)
  Cc: guile-devel

hanwen@byrd.xs4all.nl (Han-Wen Nienhuys) writes:

> See CVS.

Thanks!

Ludovic.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-01-19  8:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-20 13:16 [PATCH] Accurate count of freed cells Ludovic Courtès
2005-12-23 11:14 ` Han-Wen Nienhuys
2006-01-03 10:10   ` Ludovic Courtès
2006-01-18  8:39 ` Ludovic Courtès
2006-01-18 10:37   ` Han-Wen Nienhuys
2006-01-19  8:27     ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).