Mercurial > hg > xemacs-beta
annotate tests/sigpipe.c @ 2775:05d62157e048
[xemacs-hg @ 2005-05-15 16:37:52 by crestani]
New allocator improvements
lisp/ChangeLog addition:
2005-05-15 Marcus Crestani <crestani@xemacs.org>
* diagnose.el: Lrecord and string data statistics.
* diagnose.el (show-memory-usage): Add output for additional
lrecord statistics (currently only string data).
* diagnose.el (show-lrecord-stats): New. Print detailed lrecord
statistics.
src/ChangeLog addition:
2005-05-15 Marcus Crestani <crestani@xemacs.org>
* alloc.c: Add string data statistics.
* alloc.c (dec_lrecord_stats): Use size of lrecord for statistics
and cons counter bookkeeping.
* alloc.c (finalize_string): Add string data statistics.
* alloc.c (make_uninit_string): Add string data statistics.
* alloc.c (make_string_nocopy): Add string data statistics.
* alloc.c (kkcc_marking): Move break out of #ifdef.
* alloc.c (Flrecord_stats): New. Collect lrecord statistics.
* alloc.c (Fgarbage_collect): Use Flrecord_stats.
* alloc.c (syms_of_alloc): Add Flrecord_stats.
* dumper.c: Fix hash table.
* dumper.c (pdump_make_hash): Fix hash table.
* dumper.c (pdump_get_mc_addr): Fix hash table.
* dumper.c (pdump_put_mc_addr): Fix hash table.
* dumper.c (pdump_reloc_one_mc): Fix indentation.
* dumper.c (pdump_load_finish): Add lrecord statistics
bookkeeping.
* lrecord.h: Add string data statistics.
* mc-alloc.c (remove_cell): Lrecord statistics, fix indentation.
* mule-charset.c: Marking through *_unicode_description not
needed.
* symbols.c (init_symbols_once_early): Bump lrecord statistics.
* window.c: Marking through line_start_cache not needed.
* xemacs.def.in.in: Fix typo.
author | crestani |
---|---|
date | Sun, 15 May 2005 16:38:14 +0000 |
parents | 3f6adebda25c |
children | 679041362cd4 |
rev | line source |
---|---|
1231 | 1 /* code is all from loser.c and loser.el by Mly |
2 | |
3 Copyright (C) 2002 Richard Mlynarik <mly@pobox.com> | |
4 | |
5 This is part of XEmacs | |
6 | |
7 Compile this file. Run it in the background giving it a command line | |
8 argument PORT which is a positive integer 1024 < PORT < 32768 (avoid the | |
9 numbers assigned in /etc/services). | |
10 | |
11 Then start up a fresh (you're going to crash) XEmacs. Execute the following | |
12 | |
13 (defun lose (port) | |
14 (interactive "nUrk: ") | |
15 (require 'comint) | |
16 (while t | |
17 (condition-case e | |
18 (let* ((name "*lose*") | |
19 (b (get-buffer-create name))) | |
20 (switch-to-buffer b) | |
21 (comint-mode) | |
22 (comint-exec b name (cons "127.0.0.1" port) nil '()) | |
23 (process-send-string (get-buffer-process b) "\377\373\001") | |
24 (process-send-string (get-buffer-process b) "\377\373\001")) | |
25 (error (message "URK: %s" e)) (sit-for 1)))) | |
26 | |
27 Then M-x lose RET PORT RET and you lose big (in XEmacs 21.1, anyway). | |
28 Note: the error messages are proper functioning. What should eventually | |
29 happen after a number of SIGPIPEs is that you get a SIGSEGV and life is | |
30 bad and XEmacs is dead. | |
31 */ | |
32 | |
33 #include <arpa/inet.h> | |
34 | |
35 int | |
36 main (int argc, char **argv) | |
37 { | |
38 struct sockaddr_in junk; | |
39 int s; | |
40 | |
41 memset (&junk, 0, sizeof (junk)); | |
42 | |
43 junk.sin_family = AF_INET; | |
44 junk.sin_addr.s_addr = htonl (INADDR_ANY); /* un*x sucks */ | |
45 junk.sin_port = htons (atoi (argv[1])); /* un*x blows */ | |
46 | |
47 s = socket (PF_INET, SOCK_STREAM, 0); | |
48 | |
49 bind (s, (struct sockaddr *)&junk, sizeof (junk)); | |
50 | |
51 listen (s, 1); | |
52 | |
53 for (;;) | |
54 { | |
55 int loser = accept (s, NULL, 0); | |
56 close (loser); | |
57 } | |
58 } | |
59 |