From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: [Ludovic =?iso-8859-1?q?Court=E8s=5D?= Re: [PATCH] GC code cleanup #2 Date: Mon, 13 Feb 2006 10:15:25 +0100 Organization: LAAS-CNRS Message-ID: <871wy7sjpu.fsf@laas.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1139822390 30285 80.91.229.2 (13 Feb 2006 09:19:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Feb 2006 09:19:50 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Feb 13 10:19:46 2006 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F8Zs1-000570-F8 for guile-devel@m.gmane.org; Mon, 13 Feb 2006 10:19:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F8Zry-0001hI-25 for guile-devel@m.gmane.org; Mon, 13 Feb 2006 04:19:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F8Zo5-0000GM-EE for guile-devel@gnu.org; Mon, 13 Feb 2006 04:15:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F8Zo1-0000FH-Qj for guile-devel@gnu.org; Mon, 13 Feb 2006 04:15:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F8Zo0-0000Et-Uf for guile-devel@gnu.org; Mon, 13 Feb 2006 04:15:37 -0500 Original-Received: from [140.93.0.15] (helo=laas.laas.fr) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F8ZsQ-0006eh-AD for guile-devel@gnu.org; Mon, 13 Feb 2006 04:20:10 -0500 Original-Received: by laas.laas.fr (8.13.1/8.13.4) with SMTP id k1D9FRLm011803; Mon, 13 Feb 2006 10:15:33 +0100 (CET) Original-To: hanwen@xs4all.nl, guile-devel@gnu.org X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 25 =?iso-8859-1?Q?Pluvi=F4se?= an 214 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: hanwen@xs4all.nl, guile-devel@gnu.org User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) X-Spam-Score: 0 () X-Scanned-By: MIMEDefang at CNRS-LAAS X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:5684 Archived-At: --=-=-= Hello, I'm resending the GC-cleanup patch in a hopefully more readable form. Han-Wen: let me know if it's alright. Thanks, Ludovic. --=-=-= Content-Type: message/rfc822 Content-Disposition: inline Received: from ombre.laas.fr (ombre [195.83.132.132]) by gailuron.laas.fr (8.12.11/8.12.8) with ESMTP id k04IdgRt003916 for ; Wed, 4 Jan 2006 19:39:42 +0100 (CET) Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by ombre.laas.fr (8.13.1/8.13.4) with ESMTP id k04IdcUT010261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 4 Jan 2006 19:39:39 +0100 (CET) Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EuDX0-0006IQ-Jj for ludovic.courtes@laas.fr; Wed, 04 Jan 2006 13:38:42 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EuCHU-0007wd-51 for guile-devel@gnu.org; Wed, 04 Jan 2006 12:18:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EuCHR-0007uL-Sa for guile-devel@gnu.org; Wed, 04 Jan 2006 12:18:34 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EuCHR-0007tI-Gl for guile-devel@gnu.org; Wed, 04 Jan 2006 12:18:33 -0500 Received: from [140.93.0.15] (helo=laas.laas.fr) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EuCIr-0007e5-V6 for guile-devel@gnu.org; Wed, 04 Jan 2006 12:20:02 -0500 Received: by laas.laas.fr (8.13.1/8.13.4) with SMTP id k04HGiZV007587; Wed, 4 Jan 2006 18:16:46 +0100 (CET) From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) To: hanwen@xs4all.nl Organization: LAAS-CNRS References: <87vexjoibu.fsf@laas.fr> X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 15 =?iso-8859-1?Q?Niv=F4se?= an 214 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: hanwen@xs4all.nl, guile-devel@gnu.org Date: Wed, 04 Jan 2006 18:16:31 +0100 In-Reply-To: (Han-Wen Nienhuys's message of "Fri, 23 Dec 2005 11:23:01 +0000 (UTC)") Message-ID: <873bk3ncb4.fsf_-_@laas.fr> User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) X-Spam-Score: 0 () X-Scanned-By: MIMEDefang at CNRS-LAAS X-MIME-Autoconverted: from 8bit to quoted-printable by laas.laas.fr id k04HGiZV007587 Cc: guile-devel@gnu.org Subject: Re: [PATCH] GC code cleanup #2 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: guile-devel-bounces+ludovic.courtes=laas.fr@gnu.org Errors-To: guile-devel-bounces+ludovic.courtes=laas.fr@gnu.org X-Spam-Status: No X-MIME-Autoconverted: from quoted-printable to 8bit by gailuron.laas.fr id k04IdgRt003916 Content-Length: 15176 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by laas.laas.fr id k1D9FRLm011803 Hi, hanwen@byrd.xs4all.nl (Han-Wen Nienhuys) writes: >> void >>-scm_i_adjust_min_yield (scm_t_cell_type_statistics *freelist) >>+scm_i_adjust_min_yield (scm_t_cell_type_statistics *freelist, >>+ unsigned cells_collected, >>+ unsigned cells_swept) > > you're passing this as a combination everywhere. I think it would be > cleaner to create a > > scm_t_sweep_statistics Right, good idea. ;-) I followed you advice and below is a patch that does this. Could someone please review it and apply it if it's acceptable? Thanks, Ludovic. 2006-01-04 Ludovic Court=E8s * libguile/gc-segment.c (scm_i_sweep_some_cards): Take a SWEEP_STATS argument. Don't refer to SCM_GC_CELLS_COLLECTED and SCM_CELLS_ALLOCATED. If SEG->FIRST_TIME, let CELLS_COLLECTED as zero. Take into account SEG->SPAN when computing CELLS_SWEPT. (scm_i_sweep_segment): Take one more argument, similarly. (scm_i_sweep_all_segments): Likewise. (scm_i_sweep_some_segments): Likewise. (scm_i_adjust_min_yield): Change the way MIN_CELLS is computed: do not refer to SCM_GC_CELLS_COLLECTED. * libguile/gc-freelist.c (scm_i_adjust_min_yield): Take one more argument, an `scm_i_sweep_statistics' object. Change the way DELTA is collected: don't take into account SCM_GC_CELLS_COLLECTED_1, only SWEEP_STATS.COLLECTED. =20 * libguile/gc-malloc.c (scm_realloc): Pass an extra argument to `scm_i_sweep_all_segments ()'. =20 * libguile/gc.c (gc_start_stats): Updated accordingly. (gc_end_stats): Take an additional SWEEP_STATS argument. Decrement SCM_CELLS_ALLOCATED after calls to `scm_i_sweep_* ()'. (scm_gc_for_newcell): Updated callers of `scm_i_sweep_*'. Decrement SCM_CELLS_ALLOCATED. (scm_i_gc): Likewise. =20 * libguile/private-gc.h (scm_i_sweep_*): Updated function prototypes accordingly. (scm_t_sweep_statistics): New type. (scm_i_sweep_statistics_init): New macro. (scm_i_sweep_statistics_sum): New macro =0C --- orig/libguile/gc-freelist.c +++ mod/libguile/gc-freelist.c @@ -78,7 +78,8 @@ */ =20 void -scm_i_adjust_min_yield (scm_t_cell_type_statistics *freelist) +scm_i_adjust_min_yield (scm_t_cell_type_statistics *freelist, + scm_t_sweep_statistics sweep_stats) { /* min yield is adjusted upwards so that next predicted total yield * (allocated cells actually freed by GC) becomes @@ -98,7 +99,7 @@ { /* Pick largest of last two yields. */ long delta =3D ((SCM_HEAP_SIZE * freelist->min_yield_fraction / 10= 0) - - (long) SCM_MAX (scm_gc_cells_collected_1, scm_gc_cells_collected)= ); + - (long) sweep_stats.collected); #ifdef DEBUGINFO fprintf (stderr, " after GC =3D %lu, delta =3D %ld\n", (unsigned long) scm_cells_allocated, --- orig/libguile/gc-malloc.c +++ mod/libguile/gc-malloc.c @@ -105,6 +105,7 @@ scm_realloc (void *mem, size_t size) { void *ptr; + scm_t_sweep_statistics sweep_stats; =20 SCM_SYSCALL (ptr =3D realloc (mem, size)); if (ptr) @@ -113,7 +114,7 @@ scm_i_scm_pthread_mutex_lock (&scm_i_sweep_mutex); scm_gc_running_p =3D 1; =20 - scm_i_sweep_all_segments ("realloc"); + scm_i_sweep_all_segments ("realloc", &sweep_stats); =20 SCM_SYSCALL (ptr =3D realloc (mem, size)); if (ptr) @@ -124,7 +125,7 @@ } =20 scm_i_gc ("realloc"); - scm_i_sweep_all_segments ("realloc"); + scm_i_sweep_all_segments ("realloc", &sweep_stats); =20 scm_gc_running_p =3D 0; scm_i_pthread_mutex_unlock (&scm_i_sweep_mutex); @@ -220,13 +221,14 @@ { unsigned long prev_alloced; float yield; - =20 + scm_t_sweep_statistics sweep_stats; + scm_i_scm_pthread_mutex_lock (&scm_i_sweep_mutex); scm_gc_running_p =3D 1; =20 prev_alloced =3D mallocated; scm_i_gc (what); - scm_i_sweep_all_segments ("mtrigger"); + scm_i_sweep_all_segments ("mtrigger", &sweep_stats); =20 yield =3D (((float) prev_alloced - (float) scm_mallocated) / (float) prev_alloced); --- orig/libguile/gc-segment.c +++ mod/libguile/gc-segment.c @@ -140,15 +140,13 @@ scm_i_segment_card_count (seg) * SCM_GC_CARD_BVEC_SIZE_IN_LONGS * SC= M_SIZEOF_LONG); } =20 -/* - Sweep cards from SEG until we've gathered THRESHOLD cells - =20 - RETURN: - - Freelist.=20 -*/ +/* Sweep cards from SEG until we've gathered THRESHOLD cells. On return= , + *CELLS_SWEPT contains the number of cells that have been visited and + *CELLS_COLLECTED contains the number of cells actually collected. A + freelist is returned, potentially empty. */ SCM -scm_i_sweep_some_cards (scm_t_heap_segment *seg) +scm_i_sweep_some_cards (scm_t_heap_segment *seg, + scm_t_sweep_statistics *sweep_stats) { SCM cells =3D SCM_EOL; int threshold =3D 512; @@ -158,7 +156,7 @@ =20 scm_t_cell * next_free =3D seg->next_free_card; int cards_swept =3D 0; - =20 + while (collected < threshold && next_free < seg->bounds[1]) { collected +=3D (*sweeper) (next_free, &cells, seg); @@ -166,14 +164,18 @@ cards_swept ++; } =20 - scm_gc_cells_swept +=3D cards_swept * (SCM_GC_CARD_N_CELLS - SCM_GC_C= ARD_N_HEADER_CELLS); - scm_gc_cells_collected +=3D collected * seg->span; + sweep_stats->swept =3D cards_swept * seg->span + * (SCM_GC_CARD_N_CELLS - SCM_GC_CARD_N_HEADER_CELLS); =20 if (!seg->first_time) - scm_cells_allocated -=3D collected * seg->span; - =20 - seg->freelist->collected +=3D collected * seg->span; - =20 + { + /* scm_cells_allocated -=3D collected * seg->span; */ + sweep_stats->collected =3D collected * seg->span; + } + else + sweep_stats->collected =3D 0; + + seg->freelist->collected +=3D collected * seg->span; =20 if(next_free =3D=3D seg->bounds[1]) { @@ -196,31 +198,33 @@ segment again, the statistics are off. */ void -scm_i_sweep_segment (scm_t_heap_segment * seg) +scm_i_sweep_segment (scm_t_heap_segment *seg, + scm_t_sweep_statistics *sweep_stats) { + scm_t_sweep_statistics sweep; scm_t_cell * p =3D seg->next_free_card; - int yield =3D scm_gc_cells_collected; - int coll =3D seg->freelist->collected; - unsigned long alloc =3D scm_cells_allocated ; - =20 - while (scm_i_sweep_some_cards (seg) !=3D SCM_EOL) - ; =20 - scm_gc_cells_collected =3D yield; - scm_cells_allocated =3D alloc; - seg->freelist->collected =3D coll;=20 - =20 + scm_i_sweep_statistics_init (sweep_stats); + + while (scm_i_sweep_some_cards (seg, &sweep) !=3D SCM_EOL) + scm_i_sweep_statistics_sum (sweep_stats, sweep); + seg->next_free_card =3Dp; } =20 void -scm_i_sweep_all_segments (char const *reason) +scm_i_sweep_all_segments (char const *reason, + scm_t_sweep_statistics *sweep_stats) { - int i=3D 0;=20 + unsigned i=3D 0; =20 + scm_i_sweep_statistics_init (sweep_stats); for (i =3D 0; i < scm_i_heap_segment_table_size; i++) { - scm_i_sweep_segment (scm_i_heap_segment_table[i]); + scm_t_sweep_statistics sweep; + + scm_i_sweep_segment (scm_i_heap_segment_table[i], &sweep); + scm_i_sweep_statistics_sum (sweep_stats, sweep); } } =20 @@ -317,29 +321,35 @@ } =20 SCM -scm_i_sweep_some_segments (scm_t_cell_type_statistics * fl) +scm_i_sweep_some_segments (scm_t_cell_type_statistics *fl, + scm_t_sweep_statistics *sweep_stats) { int i =3D fl->heap_segment_idx; SCM collected =3D SCM_EOL; - =20 + + scm_i_sweep_statistics_init (sweep_stats); if (i =3D=3D -1) i++; - =20 + for (; i < scm_i_heap_segment_table_size; i++) { + scm_t_sweep_statistics sweep; + if (scm_i_heap_segment_table[i]->freelist !=3D fl) continue; - =20 - collected =3D scm_i_sweep_some_cards (scm_i_heap_segment_table[i])= ; =20 + collected =3D scm_i_sweep_some_cards (scm_i_heap_segment_table[i], + &sweep); + + scm_i_sweep_statistics_sum (sweep_stats, sweep); =20 if (collected !=3D SCM_EOL) /* Don't increment i */ break; } =20 fl->heap_segment_idx =3D i; - =20 + return collected; } =20 @@ -479,8 +489,7 @@ */ float f =3D freelist->min_yield_fraction / 100.0; float h =3D SCM_HEAP_SIZE; - float min_cells - =3D (f * h - scm_gc_cells_collected) / (1.0 - f); + float min_cells =3D (f * h - scm_gc_cells_collected) / (1.0 - f); =20 /* Make heap grow with factor 1.5 */ len =3D freelist->heap_size / 2; --- orig/libguile/gc.c +++ mod/libguile/gc.c @@ -403,31 +403,32 @@ { t_before_gc =3D scm_c_get_internal_run_time (); =20 - scm_gc_cells_marked_acc +=3D (double) scm_gc_cells_swept - - (double) scm_gc_cells_collected; - scm_gc_cells_swept_acc +=3D (double) scm_gc_cells_swept; - - scm_gc_cell_yield_percentage =3D ( scm_gc_cells_collected * 100 ) / SC= M_HEAP_SIZE;=20 - =20 - scm_gc_cells_swept =3D 0; - scm_gc_cells_collected_1 =3D scm_gc_cells_collected; - - /* - CELLS SWEPT is another word for the number of cells that were - examined during GC. YIELD is the number that we cleaned - out. MARKED is the number that weren't cleaned.=20 - */ - scm_gc_cells_collected =3D 0; scm_gc_malloc_collected =3D 0; scm_gc_ports_collected =3D 0; } =20 static void -gc_end_stats () +gc_end_stats (scm_t_sweep_statistics sweep_stats) { unsigned long t =3D scm_c_get_internal_run_time (); scm_gc_time_taken +=3D (t - t_before_gc); =20 + /* + CELLS SWEPT is another word for the number of cells that were + examined during GC. YIELD is the number that we cleaned + out. MARKED is the number that weren't cleaned. + */ + scm_gc_cells_marked_acc +=3D (double) sweep_stats.swept + - (double) scm_gc_cells_collected; + scm_gc_cells_swept_acc +=3D (double) sweep_stats.swept; + + scm_gc_cell_yield_percentage =3D (sweep_stats.collected * 100) / SCM_H= EAP_SIZE; + + scm_gc_cells_swept =3D sweep_stats.swept; + scm_gc_cells_collected_1 =3D scm_gc_cells_collected; + scm_gc_cells_collected =3D sweep_stats.collected; + scm_cells_allocated -=3D sweep_stats.collected; + ++scm_gc_times; } =20 @@ -478,15 +479,19 @@ { SCM cell; int did_gc =3D 0; -=20 + scm_t_sweep_statistics sweep_stats; + scm_i_scm_pthread_mutex_lock (&scm_i_sweep_mutex); scm_gc_running_p =3D 1; =20 - *free_cells =3D scm_i_sweep_some_segments (freelist); + *free_cells =3D scm_i_sweep_some_segments (freelist, &sweep_stats); + scm_cells_allocated -=3D sweep_stats.collected; + if (*free_cells =3D=3D SCM_EOL && scm_i_gc_grow_heap_p (freelist)) { freelist->heap_segment_idx =3D scm_i_get_new_heap_segment (freelis= t, abort_on_error); - *free_cells =3D scm_i_sweep_some_segments (freelist); + *free_cells =3D scm_i_sweep_some_segments (freelist, &sweep_stats)= ; + scm_cells_allocated -=3D sweep_stats.collected; } =20 if (*free_cells =3D=3D SCM_EOL) @@ -495,7 +500,7 @@ with the advent of lazy sweep, GC yield is only known just before doing the GC. */ - scm_i_adjust_min_yield (freelist); + scm_i_adjust_min_yield (freelist, sweep_stats); =20 /* out of fresh cells. Try to get some new ones. @@ -504,7 +509,8 @@ did_gc =3D 1; scm_i_gc ("cells"); =20 - *free_cells =3D scm_i_sweep_some_segments (freelist); + *free_cells =3D scm_i_sweep_some_segments (freelist, &sweep_stats)= ; + scm_cells_allocated -=3D sweep_stats.collected; } =20 if (*free_cells =3D=3D SCM_EOL) @@ -513,7 +519,8 @@ failed getting new cells. Get new juice or die. */ freelist->heap_segment_idx =3D scm_i_get_new_heap_segment (freelis= t, abort_on_error); - *free_cells =3D scm_i_sweep_some_segments (freelist); + *free_cells =3D scm_i_sweep_some_segments (freelist, &sweep_stats)= ; + scm_cells_allocated -=3D sweep_stats.collected; } =20 if (*free_cells =3D=3D SCM_EOL) @@ -545,6 +552,8 @@ void scm_i_gc (const char *what) { + scm_t_sweep_statistics sweep_stats; + scm_i_thread_put_to_sleep (); =20 scm_c_hook_run (&scm_before_gc_c_hook, 0); @@ -571,7 +580,12 @@ Let's finish the sweep. The conservative GC might point into the garbage, and marking that would create a mess. */ - scm_i_sweep_all_segments("GC"); + scm_i_sweep_all_segments ("GC", &sweep_stats); + + /* Invariant: the number of cells collected (i.e., freed) must always = be + lower than or equal to the number of cells "swept" (i.e., visited).= */ + assert (sweep_stats.collected <=3D sweep_stats.swept); + if (scm_mallocated < scm_i_deprecated_memory_return) { /* The byte count of allocated objects has underflowed. This is @@ -624,7 +638,7 @@ scm_gc_sweep (); scm_c_hook_run (&scm_after_sweep_c_hook, 0); =20 - gc_end_stats (); + gc_end_stats (sweep_stats); =20 scm_i_thread_wake_up (); =20 @@ -635,6 +649,7 @@ */ } =20 + =0C /* {GC Protection Helper Functions} */ --- orig/libguile/private-gc.h +++ mod/libguile/private-gc.h @@ -118,11 +118,40 @@ } scm_t_cell_type_statistics; =20 =20 +/* Sweep statistics. */ +typedef struct scm_sweep_statistics +{ + /* Number of cells "swept", i.e., visited during the sweep operation. = */ + unsigned swept; + + /* Number of cells collected during the sweep operation. This number = must + alsways be lower than or equal to SWEPT. */ + unsigned collected; +} scm_t_sweep_statistics; + +#define scm_i_sweep_statistics_init(_stats) \ + do \ + { \ + (_stats)->swept =3D (_stats)->collected =3D 0; \ + } \ + while (0) + +#define scm_i_sweep_statistics_sum(_sum, _addition) \ + do \ + { \ + (_sum)->swept +=3D (_addition).swept; \ + (_sum)->collected +=3D (_addition).collected; \ + } \ + while (0) + + +=0C extern scm_t_cell_type_statistics scm_i_master_freelist; extern scm_t_cell_type_statistics scm_i_master_freelist2; extern unsigned long scm_gc_cells_collected_1; =20 -void scm_i_adjust_min_yield (scm_t_cell_type_statistics *freelist); +void scm_i_adjust_min_yield (scm_t_cell_type_statistics *freelist, + scm_t_sweep_statistics sweep_stats); void scm_i_gc_sweep_freelist_reset (scm_t_cell_type_statistics *freelist= ); int scm_i_gc_grow_heap_p (scm_t_cell_type_statistics * freelist); =20 @@ -221,8 +250,10 @@ =20 void scm_i_clear_segment_mark_space (scm_t_heap_segment *seg); scm_t_heap_segment * scm_i_make_empty_heap_segment (scm_t_cell_type_stat= istics*); -SCM scm_i_sweep_some_cards (scm_t_heap_segment *seg); -void scm_i_sweep_segment (scm_t_heap_segment * seg); +SCM scm_i_sweep_some_cards (scm_t_heap_segment *seg, + scm_t_sweep_statistics *sweep_stats); +void scm_i_sweep_segment (scm_t_heap_segment *seg, + scm_t_sweep_statistics *sweep_stats); =20 void scm_i_heap_segment_statistics (scm_t_heap_segment *seg, SCM tab); =20 @@ -232,9 +263,11 @@ int scm_i_get_new_heap_segment (scm_t_cell_type_statistics *, policy_on_= error); void scm_i_clear_mark_space (void); void scm_i_sweep_segments (void); -SCM scm_i_sweep_some_segments (scm_t_cell_type_statistics * fl); +SCM scm_i_sweep_some_segments (scm_t_cell_type_statistics *fl, + scm_t_sweep_statistics *sweep_stats); void scm_i_reset_segments (void); -void scm_i_sweep_all_segments (char const *reason); +void scm_i_sweep_all_segments (char const *reason, + scm_t_sweep_statistics *sweep_stats); SCM scm_i_all_segments_statistics (SCM hashtab); void scm_i_make_initial_segment (int init_heap_size, scm_t_cell_type_sta= tistics *freelist); =20 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --=-=-=--