Miles Bader <[EMAIL PROTECTED]> writes: > On 6/26/05, Adrian Aichner <[EMAIL PROTECTED]> wrote: >> >> isn't that the purpose of >> >> gc-cons-percentage >> > >> > There is no such variable in Emacs. >> >> Oh, so it's a XEmacs-only thing. > > OK; guess if we add this feature, we should use the same variable > name though. > > As Gaƫtan Leurent pointed out, it's also a good idea to apply min/max > bounds to the calculated value, to handle extreme cases; what does > xemacs do about that?
Oops, this feature not currently enabled in XEmacs! See recompute_need_to_garbage_collect in alloc.c. Here is its documentation from the trunk version of alloc.c anyway: DEFVAR_INT ("gc-cons-percentage", &gc_cons_percentage /* *Percentage of memory allocated between garbage collections. Garbage collection will happen if this percentage of the total amount of memory used for data has been allocated since the last garbage collection. However, it will not happen if less than `gc-cons-threshold' bytes have been allocated -- this sets an absolute minimum in case very little data has been allocated or the percentage is set very low. Set this to 0 to have garbage collection always happen after `gc-cons-threshold' bytes have been allocated, regardless of current memory usage. Garbage collection happens automatically when `eval' or `funcall' are called. (Note that `funcall' is called implicitly as part of evaluation.) By binding this temporarily to a large number, you can effectively prevent garbage collection during a part of the program. See also `consing-since-gc'. */ ); So, gc-cons-threshold serves as the lower bound, and gc-cons-percentage itself is the upper. Adrian > > [I'm thinking a minimum of say the current default (400K), and a max > of oh, 8MB.] > > -Miles -- Adrian Aichner mailto:[EMAIL PROTECTED] http://www.xemacs.org/ _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel