Mercurial > hg > xemacs-beta
annotate src/s/freebsd.h @ 5146:88bd4f3ef8e4
make lrecord UID's have a separate UID space for each object, resurrect debug SOE code in extents.c
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-03-15 Ben Wing <ben@xemacs.org>
* alloc.c:
* alloc.c (c_readonly):
* alloc.c (deadbeef_memory):
* alloc.c (make_compiled_function):
* alloc.c (make_button_data):
* alloc.c (make_motion_data):
* alloc.c (make_process_data):
* alloc.c (make_timeout_data):
* alloc.c (make_magic_data):
* alloc.c (make_magic_eval_data):
* alloc.c (make_eval_data):
* alloc.c (make_misc_user_data):
* alloc.c (noseeum_make_marker):
* alloc.c (ADDITIONAL_FREE_string):
* alloc.c (common_init_alloc_early):
* alloc.c (init_alloc_once_early):
* bytecode.c (print_compiled_function):
* bytecode.c (mark_compiled_function):
* casetab.c:
* casetab.c (print_case_table):
* console.c:
* console.c (print_console):
* database.c (print_database):
* database.c (finalize_database):
* device-msw.c (sync_printer_with_devmode):
* device-msw.c (print_devmode):
* device-msw.c (finalize_devmode):
* device.c:
* device.c (print_device):
* elhash.c:
* elhash.c (print_hash_table):
* eval.c (print_multiple_value):
* eval.c (mark_multiple_value):
* events.c (deinitialize_event):
* events.c (print_event):
* events.c (event_equal):
* extents.c:
* extents.c (soe_dump):
* extents.c (soe_insert):
* extents.c (soe_delete):
* extents.c (soe_move):
* extents.c (extent_fragment_update):
* extents.c (print_extent_1):
* extents.c (print_extent):
* extents.c (vars_of_extents):
* frame.c:
* frame.c (print_frame):
* free-hook.c:
* free-hook.c (check_free):
* glyphs.c:
* glyphs.c (print_image_instance):
* glyphs.c (print_glyph):
* gui.c:
* gui.c (copy_gui_item):
* hash.c:
* hash.c (NULL_ENTRY):
* hash.c (KEYS_DIFFER_P):
* keymap.c (print_keymap):
* keymap.c (MARKED_SLOT):
* lisp.h:
* lrecord.h:
* lrecord.h (LISP_OBJECT_UID):
* lrecord.h (set_lheader_implementation):
* lrecord.h (struct old_lcrecord_header):
* lstream.c (print_lstream):
* lstream.c (finalize_lstream):
* marker.c (print_marker):
* marker.c (marker_equal):
* mc-alloc.c (visit_all_used_page_headers):
* mule-charset.c:
* mule-charset.c (print_charset):
* objects.c (print_color_instance):
* objects.c (print_font_instance):
* objects.c (finalize_font_instance):
* opaque.c (print_opaque):
* opaque.c (print_opaque_ptr):
* opaque.c (equal_opaque_ptr):
* print.c (internal_object_printer):
* print.c (enum printing_badness):
* rangetab.c (print_range_table):
* rangetab.c (range_table_equal):
* specifier.c (print_specifier):
* specifier.c (finalize_specifier):
* symbols.c:
* symbols.c (print_symbol_value_magic):
* tooltalk.c:
* tooltalk.c (print_tooltalk_message):
* tooltalk.c (print_tooltalk_pattern):
* window.c (print_window):
* window.c (debug_print_window):
(1) Make lrecord UID's have a separate UID space for each object.
Otherwise, with 20-bit UID's, we rapidly wrap around, especially
when common objects like conses and strings increment the UID value
for every object created. (Originally I tried making two UID spaces,
one for objects that always print readably and hence don't display
the UID, and one for other objects. But certain objects like markers
for which a UID is displayed are still generated rapidly enough that
UID overflow is a serious issue.) This also has the advantage of
making UID values smaller, hence easier to remember -- their main
purpose is to make it easier to keep track of different objects of
the same type when debugging code. Make sure we dump lrecord UID's
so that we don't have problems with pdumped and non-dumped objects
having the same UID.
(2) Display UID's consistently whenever an object (a) doesn't
consistently print readably (objects like cons and string, which
always print readably, can't display a UID), and (b) doesn't
otherwise have a unique property that makes objects of a
particular type distinguishable. (E.g. buffers didn't and still
don't print an ID, but the buffer name uniquely identifies the
buffer.) Some types, such as event, extent, compiled-function,
didn't always (or didn't ever) display an ID; others (such as
marker, extent, lstream, opaque, opaque-ptr, any object using
internal_object_printer()) used to display the actual machine
pointer instead.
(3) Rename NORMAL_LISP_OBJECT_UID to LISP_OBJECT_UID; make it work
over all Lisp objects and take a Lisp object, not a struct pointer.
(4) Some misc cleanups in alloc.c, elhash.c.
(5) Change code in events.c that "deinitializes" an event so that
it doesn't increment the event UID counter in the process. Also
use deadbeef_memory() to overwrite memory instead of doing the same
with custom code. In the process, make deadbeef_memory() in
alloc.c always available, and delete extraneous copy in mc-alloc.c.
Also capitalize all uses of 0xDEADBEEF. Similarly in elhash.c
call deadbeef_memory().
(6) Resurrect "debug SOE" code in extents.c. Make it conditional
on DEBUG_XEMACS and on a `debug-soe' variable, rather than on
SOE_DEBUG. Make it output to stderr, not stdout.
(7) Delete some custom print methods that were identical to
external_object_printer().
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 15 Mar 2010 16:35:38 -0500 |
parents | 22858d5a5a7f |
children | 861f2601a38b |
rev | line source |
---|---|
428 | 1 /* Synched up with: FSF 19.31. */ |
2 | |
3 /* s/ file for freebsd system. */ | |
4 | |
5 /* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up. | |
6 Earlier versions do not have shared libraries, so inhibit them. | |
7 You can inhibit them on newer systems if you wish | |
8 by defining NO_SHARED_LIBS. */ | |
9 #ifndef __FreeBSD__ | |
10 #define NO_SHARED_LIBS | |
11 #endif | |
12 | |
13 /* Get most of the stuff from bsd4.3 */ | |
14 #include "bsd4-3.h" | |
15 | |
16 /* For mem-limits.h. */ | |
17 #define BSD4_2 | |
18 | |
19 /* These aren't needed, since we have getloadavg. */ | |
20 #undef KERNEL_FILE | |
21 #undef LDAV_SYMBOL | |
22 | |
23 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base) | |
24 | |
442 | 25 #define INTERRUPTIBLE_OPEN |
26 | |
428 | 27 #define LIBS_DEBUG |
28 /* FreeBSD 2.2 or later */ | |
29 #ifndef __FreeBSD_version | |
30 #include <osreldate.h> | |
31 #endif | |
2604 | 32 #if __FreeBSD_version >= 199701 && __FreeBSD_version < 600006 |
428 | 33 #define LIBS_SYSTEM "-lutil -lxpg4" |
34 #else | |
35 #define LIBS_SYSTEM "-lutil" | |
36 #endif | |
37 | |
38 #ifndef NOT_C_CODE | |
39 #ifdef BSD /* fixing BSD define */ | |
40 #undef BSD | |
41 #endif | |
42 #include <sys/param.h> | |
43 /* Kludge to work around setlocale(LC_ALL,...) not working after 01/1997 */ | |
44 #if __FreeBSD_version >= 199701 && __FreeBSD_version < 226000 | |
45 #ifdef HAVE_X_WINDOWS | |
46 #include <X11/Xlocale.h> | |
47 #define setlocale(locale_category, locale_spec) setlocale(LC_CTYPE, locale_spec) | |
48 #endif /* HAVE X */ | |
49 #endif /* FreeBSD >= 199701 && < 226000 */ | |
50 #endif /* C code */ | |
51 | |
52 #define LIBS_TERMCAP "-ltermcap" | |
53 | |
54 #ifdef __ELF__ /* since from 3.0-CURRENT(maybe 19980831 or later) */ | |
55 #ifndef NOT_C_CODE | |
56 #include <stddef.h> | |
57 #endif | |
58 #define LD_SWITCH_SYSTEM | |
59 #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o | |
60 #define UNEXEC "unexelf.o" | |
61 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o | |
62 #define LINKER "$(CC) -nostdlib" | |
63 #undef LIB_GCC | |
64 #define LIB_GCC | |
65 | |
66 #else /* not __ELF__ */ | |
67 | |
68 #ifndef NO_SHARED_LIBS | |
69 #if 0 /* mrb */ | |
70 #define LIB_GCC "-lgcc" | |
71 #define LD_SWITCH_SYSTEM "-dc -dp -e start" | |
72 #define START_FILES "pre-crt0.o /usr/lib/crt0.o" | |
73 #else /* mrb */ | |
74 #define ORDINARY_LINK | |
75 #undef LIB_GCC | |
76 #undef LD_SWITCH_SYSTEM | |
77 #undef START_FILES | |
78 #endif /* mrb */ | |
79 | |
80 #define HAVE_TEXT_START /* No need to define `start_of_text'. */ | |
81 #define UNEXEC "unexfreebsd.o" | |
82 #define RUN_TIME_REMAP | |
83 | |
84 #ifndef N_TRELOFF | |
85 #define N_PAGSIZ(x) __LDPGSZ | |
86 #define N_BSSADDR(x) (N_ALIGN(x, N_DATADDR(x)+x.a_data)) | |
87 #define N_TRELOFF(x) N_RELOFF(x) | |
88 #endif | |
89 #else /* NO_SHARED_LIBS */ | |
90 #ifdef __FreeBSD__ /* shared libs are available, but the user prefers | |
91 not to use them. */ | |
92 #define LD_SWITCH_SYSTEM "-Bstatic" | |
93 #define A_TEXT_OFFSET(x) (sizeof (struct exec)) | |
94 #define A_TEXT_SEEK(hdr) (N_TXTOFF(hdr) + A_TEXT_OFFSET(hdr)) | |
95 #endif /* __FreeBSD__ */ | |
96 #endif /* NO_SHARED_LIBS */ | |
97 | |
98 #endif /* not __ELF__ */ | |
99 | |
100 /* #define NO_TERMIO */ /* detected in configure */ | |
101 #define DECLARE_GETPWUID_WITH_UID_T | |
102 | |
771 | 103 /* freebsd uses OXTABS instead of the expected TAB3. */ |
104 #define TABDLY OXTABS | |
105 #define TAB3 OXTABS |