Mercurial > hg > xemacs-beta
annotate tests/automated/c-tests.el @ 5158:9e0b43d3095c
more cleanups to object-memory-usage stuff
-------------------- ChangeLog entries follow: --------------------
lisp/ChangeLog addition:
2010-03-19 Ben Wing <ben@xemacs.org>
* diagnose.el (show-object-memory-usage-stats):
Rewrite to take into account non-lisp-storage statistics
returned by garbage-collect-1 and friends.
src/ChangeLog addition:
2010-03-19 Ben Wing <ben@xemacs.org>
* alloc.c:
* alloc.c (struct):
* alloc.c (tick_lrecord_stats):
* alloc.c (gc_sweep_1):
* alloc.c (finish_object_memory_usage_stats):
* alloc.c (object_memory_usage_stats):
* alloc.c (compute_memusage_stats_length):
Call new memory-usage mechanism at sweep time to compute extra
memory utilization for all objects. Add up the values element-by-
element to get an aggregrate set of statistics, where each is the
sum of the values of a single statistic across different objects
of the same type. At end of sweep time, call
finish_object_memory_usage_stats() to add up all the aggreggrate
stats that are related to non-Lisp memory storage to compute
a single value, and add it to the list of values returned by
`garbage-collect' and `object-memory-usage-stats'.
* buffer.c (compute_buffer_text_usage):
Don't crash on buffers without text (killed buffers?) and don't
double-count indirect buffers.
* elhash.c:
* elhash.c (hash_table_objects_create):
* elhash.c (vars_of_elhash):
* symsinit.h:
Add memory-usage method to count the size of `hentries'.
* emacs.c (main_1):
Call new functions in elhash.c, frame.c at init.
* frame.c:
* frame.c (compute_frame_usage):
* frame.c (frame_memory_usage):
* frame.c (frame_objects_create):
* symsinit.h:
Add memory-usage method to count gutter display structures,
subwindow exposures.
* gc.c (gc_finish):
* lisp.h:
Declare finish_object_memory_usage_stats(), call it in gc_finish().
* lrecord.h (struct lrecord_implementation):
* lrecord.h (INIT_MEMORY_USAGE_STATS):
New value in implementation struct to track number of non-Lisp-memory
statistics. Computed in alloc.c.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Fri, 19 Mar 2010 14:47:44 -0500 |
parents | 6bff4f219697 |
children | 308d34e9f07d |
rev | line source |
---|---|
404 | 1 ;; Copyright (C) 2000 Martin Buchholz |
5156
6bff4f219697
fix crash etc. in tests.c/c-tests.el
Ben Wing <ben@xemacs.org>
parents:
4747
diff
changeset
|
2 ;; Copyright (C) 2010 Ben Wing. |
404 | 3 |
4 ;; Author: Martin Buchholz <martin@xemacs.org> | |
5 ;; Maintainer: Martin Buchholz <martin@xemacs.org> | |
6 ;; Created: 1998 | |
7 ;; Keywords: tests | |
8 | |
9 ;; This file is part of XEmacs. | |
10 | |
11 ;; XEmacs is free software; you can redistribute it and/or modify it | |
12 ;; under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; XEmacs is distributed in the hope that it will be useful, but | |
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 ;; General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
24 ;; 02111-1307, USA. | |
25 | |
26 ;;; Synched up with: Not in FSF. | |
27 | |
28 ;;; Commentary: | |
29 | |
30 ;;; Call tests in src/tests.c, which cannot be written using lisp only. | |
31 ;;; See test-harness.el for instructions on how to run these tests. | |
32 | |
33 (eval-when-compile | |
34 (condition-case nil | |
35 (require 'test-harness) | |
36 (file-error | |
37 (push "." load-path) | |
38 (when (and (boundp 'load-file-name) (stringp load-file-name)) | |
39 (push (file-name-directory load-file-name) load-path)) | |
40 (require 'test-harness)))) | |
41 | |
5156
6bff4f219697
fix crash etc. in tests.c/c-tests.el
Ben Wing <ben@xemacs.org>
parents:
4747
diff
changeset
|
42 (with-temp-buffer |
6bff4f219697
fix crash etc. in tests.c/c-tests.el
Ben Wing <ben@xemacs.org>
parents:
4747
diff
changeset
|
43 (when (boundp 'test-function-list) ; Only if configure --debug |
6bff4f219697
fix crash etc. in tests.c/c-tests.el
Ben Wing <ben@xemacs.org>
parents:
4747
diff
changeset
|
44 (loop for fun in test-function-list do |
6bff4f219697
fix crash etc. in tests.c/c-tests.el
Ben Wing <ben@xemacs.org>
parents:
4747
diff
changeset
|
45 ;; #### I hope there's no way we can signal ... |
6bff4f219697
fix crash etc. in tests.c/c-tests.el
Ben Wing <ben@xemacs.org>
parents:
4747
diff
changeset
|
46 (loop for result in (funcall fun) do |
6bff4f219697
fix crash etc. in tests.c/c-tests.el
Ben Wing <ben@xemacs.org>
parents:
4747
diff
changeset
|
47 (Assert (nth 1 result) (nth 2 result) (nth 0 result)))))) |