Mercurial > hg > xemacs-beta
comparison src/window.c @ 3024:b7f26b2f78bd
[xemacs-hg @ 2005-10-25 08:32:40 by ben]
more mc-alloc-related factoring; make it hard to do the wrong thing
postgresql/postgresql.c, postgresql/postgresql.h: MC-Alloc refactoring.
ldap/eldap.c, ldap/eldap.h: MC-Alloc refactoring.
alloc.c, buffer.c, console.c, emacs.c, file-coding.c, lrecord.h, lstream.c, mule-charset.c, print.c, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, symbols.c, symeval.h, unicode.c, window.c, xemacs.def.in.in: rename `struct lcrecord_header' to `struct old_lcrecord_header';
likewise for `old_basic_alloc_lcrecord', `old_free_lcrecord',
`old_zero_lcrecord', `old_zero_sized_lcrecord', `old_copy_lcrecord',
`old_copy_sized_lcrecord', `old_alloc_lcrecord_type'. Created new
LISPOBJ_STORAGE_SIZE() used only on objects created through allocation
of Lisp-Object memory instead of basic xmalloc()/xfree(). This is
distinguished from malloced_storage_size(), for non-Lisp-Objects.
The definition of LISPOBJ_STORAGE_SIZE() can reduce down to
malloced_storage_size() when not MC-ALLOC, but with MC-ALLOC it's
a different function.
The whole point other than cleaning up the use of LISPOBJ_STORAGE_SIZE
is to make it harder to accidentally use the old kind (lowercase) of
function in new code, since you get a compile error.
author | ben |
---|---|
date | Tue, 25 Oct 2005 08:32:50 +0000 |
parents | 1e7cc382eb16 |
children | facf3239ba30 |
comparison
equal
deleted
inserted
replaced
3023:d305f4207861 | 3024:b7f26b2f78bd |
---|---|
5094 struct window_stats *stats, | 5094 struct window_stats *stats, |
5095 struct overhead_stats *ovstats) | 5095 struct overhead_stats *ovstats) |
5096 { | 5096 { |
5097 if (!mir) | 5097 if (!mir) |
5098 return; | 5098 return; |
5099 stats->other += MALLOCED_STORAGE_SIZE (mir, sizeof (struct window_mirror), | 5099 stats->other += LISPOBJ_STORAGE_SIZE (mir, sizeof (*mir), ovstats); |
5100 ovstats); | |
5101 #ifdef HAVE_SCROLLBARS | 5100 #ifdef HAVE_SCROLLBARS |
5102 { | 5101 { |
5103 struct device *d = XDEVICE (FRAME_DEVICE (mir->frame)); | 5102 struct device *d = XDEVICE (FRAME_DEVICE (mir->frame)); |
5104 | 5103 |
5105 stats->scrollbar += | 5104 stats->scrollbar += |
5119 static void | 5118 static void |
5120 compute_window_usage (struct window *w, struct window_stats *stats, | 5119 compute_window_usage (struct window *w, struct window_stats *stats, |
5121 struct overhead_stats *ovstats) | 5120 struct overhead_stats *ovstats) |
5122 { | 5121 { |
5123 xzero (*stats); | 5122 xzero (*stats); |
5124 stats->other += MALLOCED_STORAGE_SIZE (w, sizeof (struct window), ovstats); | 5123 stats->other += LISPOBJ_STORAGE_SIZE (w, sizeof (*w), ovstats); |
5125 stats->face += compute_face_cachel_usage (w->face_cachels, ovstats); | 5124 stats->face += compute_face_cachel_usage (w->face_cachels, ovstats); |
5126 stats->glyph += compute_glyph_cachel_usage (w->glyph_cachels, ovstats); | 5125 stats->glyph += compute_glyph_cachel_usage (w->glyph_cachels, ovstats); |
5127 stats->line_start += | 5126 stats->line_start += |
5128 compute_line_start_cache_dynarr_usage (w->line_start_cache, ovstats); | 5127 compute_line_start_cache_dynarr_usage (w->line_start_cache, ovstats); |
5129 compute_window_mirror_usage (find_window_mirror (w), stats, ovstats); | 5128 compute_window_mirror_usage (find_window_mirror (w), stats, ovstats); |