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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
404
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
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
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
3
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
4 ;; Author: Martin Buchholz <martin@xemacs.org>
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
5 ;; Maintainer: Martin Buchholz <martin@xemacs.org>
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
6 ;; Created: 1998
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
7 ;; Keywords: tests
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
8
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
10
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
14 ;; any later version.
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
15
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
19 ;; General Public License for more details.
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
20
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
24 ;; 02111-1307, USA.
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
25
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
26 ;;; Synched up with: Not in FSF.
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
27
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
28 ;;; Commentary:
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
29
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
30 ;;; Call tests in src/tests.c, which cannot be written using lisp only.
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
31 ;;; See test-harness.el for instructions on how to run these tests.
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
32
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
33 (eval-when-compile
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
34 (condition-case nil
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
35 (require 'test-harness)
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
36 (file-error
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
37 (push "." load-path)
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
38 (when (and (boundp 'load-file-name) (stringp load-file-name))
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
39 (push (file-name-directory load-file-name) load-path))
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
40 (require 'test-harness))))
2f8bb876ab1d Import from CVS: tag r21-2-32
cvs
parents:
diff changeset
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))))))