diff options
| author | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
| commit | 971de7fb158335fbda39525feb2d7776a26bc030 (patch) | |
| tree | 605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/alloc.c | |
| parent | b8463cbfbe2c5183cf40772df2746e58b787ddeb (diff) | |
| download | emacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip | |
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C.
* src/atimer.c:
* src/bidi.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/ccl.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/doprnt.c:
* src/ecrt0.c:
* src/editfns.c:
* src/fileio.c:
* src/filelock.c:
* src/filemode.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/ftfont.c:
* src/ftxfont.c:
* src/gtkutil.c:
* src/indent.c:
* src/insdel.c:
* src/intervals.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/md5.c:
* src/menu.c:
* src/minibuf.c:
* src/prefix-args.c:
* src/print.c:
* src/ralloc.c:
* src/regex.c:
* src/region-cache.c:
* src/scroll.c:
* src/search.c:
* src/sound.c:
* src/strftime.c:
* src/syntax.c:
* src/sysdep.c:
* src/termcap.c:
* src/terminal.c:
* src/terminfo.c:
* src/textprop.c:
* src/tparam.c:
* src/undo.c:
* src/unexelf.c:
* src/window.c:
* src/xfaces.c:
* src/xfns.c:
* src/xfont.c:
* src/xftfont.c:
* src/xgselect.c:
* src/xmenu.c:
* src/xrdb.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c:
* src/xterm.c: Likewise.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 301 |
1 files changed, 101 insertions, 200 deletions
diff --git a/src/alloc.c b/src/alloc.c index 84b9007cdd5..0f81c943ad3 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -371,7 +371,7 @@ enum mem_type | |||
| 371 | 371 | ||
| 372 | static POINTER_TYPE *lisp_align_malloc (size_t, enum mem_type); | 372 | static POINTER_TYPE *lisp_align_malloc (size_t, enum mem_type); |
| 373 | static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); | 373 | static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); |
| 374 | void refill_memory_reserve (); | 374 | void refill_memory_reserve (void); |
| 375 | 375 | ||
| 376 | 376 | ||
| 377 | #if GC_MARK_STACK || defined GC_MALLOC_CHECK | 377 | #if GC_MARK_STACK || defined GC_MALLOC_CHECK |
| @@ -514,8 +514,7 @@ static POINTER_TYPE *pure_alloc (size_t, int); | |||
| 514 | /* Function malloc calls this if it finds we are near exhausting storage. */ | 514 | /* Function malloc calls this if it finds we are near exhausting storage. */ |
| 515 | 515 | ||
| 516 | void | 516 | void |
| 517 | malloc_warning (str) | 517 | malloc_warning (char *str) |
| 518 | char *str; | ||
| 519 | { | 518 | { |
| 520 | pending_malloc_warning = str; | 519 | pending_malloc_warning = str; |
| 521 | } | 520 | } |
| @@ -524,7 +523,7 @@ malloc_warning (str) | |||
| 524 | /* Display an already-pending malloc warning. */ | 523 | /* Display an already-pending malloc warning. */ |
| 525 | 524 | ||
| 526 | void | 525 | void |
| 527 | display_malloc_warning () | 526 | display_malloc_warning (void) |
| 528 | { | 527 | { |
| 529 | call3 (intern ("display-warning"), | 528 | call3 (intern ("display-warning"), |
| 530 | intern ("alloc"), | 529 | intern ("alloc"), |
| @@ -543,7 +542,7 @@ display_malloc_warning () | |||
| 543 | /* Called if we can't allocate relocatable space for a buffer. */ | 542 | /* Called if we can't allocate relocatable space for a buffer. */ |
| 544 | 543 | ||
| 545 | void | 544 | void |
| 546 | buffer_memory_full () | 545 | buffer_memory_full (void) |
| 547 | { | 546 | { |
| 548 | /* If buffers use the relocating allocator, no need to free | 547 | /* If buffers use the relocating allocator, no need to free |
| 549 | spare_memory, because we may have plenty of malloc space left | 548 | spare_memory, because we may have plenty of malloc space left |
| @@ -742,8 +741,7 @@ overrun_check_free (block) | |||
| 742 | /* Like malloc but check for no memory and block interrupt input.. */ | 741 | /* Like malloc but check for no memory and block interrupt input.. */ |
| 743 | 742 | ||
| 744 | POINTER_TYPE * | 743 | POINTER_TYPE * |
| 745 | xmalloc (size) | 744 | xmalloc (size_t size) |
| 746 | size_t size; | ||
| 747 | { | 745 | { |
| 748 | register POINTER_TYPE *val; | 746 | register POINTER_TYPE *val; |
| 749 | 747 | ||
| @@ -760,9 +758,7 @@ xmalloc (size) | |||
| 760 | /* Like realloc but check for no memory and block interrupt input.. */ | 758 | /* Like realloc but check for no memory and block interrupt input.. */ |
| 761 | 759 | ||
| 762 | POINTER_TYPE * | 760 | POINTER_TYPE * |
| 763 | xrealloc (block, size) | 761 | xrealloc (POINTER_TYPE *block, size_t size) |
| 764 | POINTER_TYPE *block; | ||
| 765 | size_t size; | ||
| 766 | { | 762 | { |
| 767 | register POINTER_TYPE *val; | 763 | register POINTER_TYPE *val; |
| 768 | 764 | ||
| @@ -783,8 +779,7 @@ xrealloc (block, size) | |||
| 783 | /* Like free but block interrupt input. */ | 779 | /* Like free but block interrupt input. */ |
| 784 | 780 | ||
| 785 | void | 781 | void |
| 786 | xfree (block) | 782 | xfree (POINTER_TYPE *block) |
| 787 | POINTER_TYPE *block; | ||
| 788 | { | 783 | { |
| 789 | if (!block) | 784 | if (!block) |
| 790 | return; | 785 | return; |
| @@ -800,8 +795,7 @@ xfree (block) | |||
| 800 | /* Like strdup, but uses xmalloc. */ | 795 | /* Like strdup, but uses xmalloc. */ |
| 801 | 796 | ||
| 802 | char * | 797 | char * |
| 803 | xstrdup (s) | 798 | xstrdup (const char *s) |
| 804 | const char *s; | ||
| 805 | { | 799 | { |
| 806 | size_t len = strlen (s) + 1; | 800 | size_t len = strlen (s) + 1; |
| 807 | char *p = (char *) xmalloc (len); | 801 | char *p = (char *) xmalloc (len); |
| @@ -813,8 +807,7 @@ xstrdup (s) | |||
| 813 | /* Unwind for SAFE_ALLOCA */ | 807 | /* Unwind for SAFE_ALLOCA */ |
| 814 | 808 | ||
| 815 | Lisp_Object | 809 | Lisp_Object |
| 816 | safe_alloca_unwind (arg) | 810 | safe_alloca_unwind (Lisp_Object arg) |
| 817 | Lisp_Object arg; | ||
| 818 | { | 811 | { |
| 819 | register struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | 812 | register struct Lisp_Save_Value *p = XSAVE_VALUE (arg); |
| 820 | 813 | ||
| @@ -835,9 +828,7 @@ static void *lisp_malloc_loser; | |||
| 835 | #endif | 828 | #endif |
| 836 | 829 | ||
| 837 | static POINTER_TYPE * | 830 | static POINTER_TYPE * |
| 838 | lisp_malloc (nbytes, type) | 831 | lisp_malloc (size_t nbytes, enum mem_type type) |
| 839 | size_t nbytes; | ||
| 840 | enum mem_type type; | ||
| 841 | { | 832 | { |
| 842 | register void *val; | 833 | register void *val; |
| 843 | 834 | ||
| @@ -881,8 +872,7 @@ lisp_malloc (nbytes, type) | |||
| 881 | call to lisp_malloc. */ | 872 | call to lisp_malloc. */ |
| 882 | 873 | ||
| 883 | static void | 874 | static void |
| 884 | lisp_free (block) | 875 | lisp_free (POINTER_TYPE *block) |
| 885 | POINTER_TYPE *block; | ||
| 886 | { | 876 | { |
| 887 | MALLOC_BLOCK_INPUT; | 877 | MALLOC_BLOCK_INPUT; |
| 888 | free (block); | 878 | free (block); |
| @@ -981,9 +971,7 @@ static struct ablock *free_ablock; | |||
| 981 | Alignment is on a multiple of BLOCK_ALIGN and `nbytes' has to be | 971 | Alignment is on a multiple of BLOCK_ALIGN and `nbytes' has to be |
| 982 | smaller or equal to BLOCK_BYTES. */ | 972 | smaller or equal to BLOCK_BYTES. */ |
| 983 | static POINTER_TYPE * | 973 | static POINTER_TYPE * |
| 984 | lisp_align_malloc (nbytes, type) | 974 | lisp_align_malloc (size_t nbytes, enum mem_type type) |
| 985 | size_t nbytes; | ||
| 986 | enum mem_type type; | ||
| 987 | { | 975 | { |
| 988 | void *base, *val; | 976 | void *base, *val; |
| 989 | struct ablocks *abase; | 977 | struct ablocks *abase; |
| @@ -1090,8 +1078,7 @@ lisp_align_malloc (nbytes, type) | |||
| 1090 | } | 1078 | } |
| 1091 | 1079 | ||
| 1092 | static void | 1080 | static void |
| 1093 | lisp_align_free (block) | 1081 | lisp_align_free (POINTER_TYPE *block) |
| 1094 | POINTER_TYPE *block; | ||
| 1095 | { | 1082 | { |
| 1096 | struct ablock *ablock = block; | 1083 | struct ablock *ablock = block; |
| 1097 | struct ablocks *abase = ABLOCK_ABASE (ablock); | 1084 | struct ablocks *abase = ABLOCK_ABASE (ablock); |
| @@ -1136,7 +1123,7 @@ lisp_align_free (block) | |||
| 1136 | a call to lisp_malloc. */ | 1123 | a call to lisp_malloc. */ |
| 1137 | 1124 | ||
| 1138 | struct buffer * | 1125 | struct buffer * |
| 1139 | allocate_buffer () | 1126 | allocate_buffer (void) |
| 1140 | { | 1127 | { |
| 1141 | struct buffer *b | 1128 | struct buffer *b |
| 1142 | = (struct buffer *) lisp_malloc (sizeof (struct buffer), | 1129 | = (struct buffer *) lisp_malloc (sizeof (struct buffer), |
| @@ -1434,7 +1421,7 @@ static int n_interval_blocks; | |||
| 1434 | /* Initialize interval allocation. */ | 1421 | /* Initialize interval allocation. */ |
| 1435 | 1422 | ||
| 1436 | static void | 1423 | static void |
| 1437 | init_intervals () | 1424 | init_intervals (void) |
| 1438 | { | 1425 | { |
| 1439 | interval_block = NULL; | 1426 | interval_block = NULL; |
| 1440 | interval_block_index = INTERVAL_BLOCK_SIZE; | 1427 | interval_block_index = INTERVAL_BLOCK_SIZE; |
| @@ -1446,7 +1433,7 @@ init_intervals () | |||
| 1446 | /* Return a new interval. */ | 1433 | /* Return a new interval. */ |
| 1447 | 1434 | ||
| 1448 | INTERVAL | 1435 | INTERVAL |
| 1449 | make_interval () | 1436 | make_interval (void) |
| 1450 | { | 1437 | { |
| 1451 | INTERVAL val; | 1438 | INTERVAL val; |
| 1452 | 1439 | ||
| @@ -1489,9 +1476,7 @@ make_interval () | |||
| 1489 | /* Mark Lisp objects in interval I. */ | 1476 | /* Mark Lisp objects in interval I. */ |
| 1490 | 1477 | ||
| 1491 | static void | 1478 | static void |
| 1492 | mark_interval (i, dummy) | 1479 | mark_interval (register INTERVAL i, Lisp_Object dummy) |
| 1493 | register INTERVAL i; | ||
| 1494 | Lisp_Object dummy; | ||
| 1495 | { | 1480 | { |
| 1496 | eassert (!i->gcmarkbit); /* Intervals are never shared. */ | 1481 | eassert (!i->gcmarkbit); /* Intervals are never shared. */ |
| 1497 | i->gcmarkbit = 1; | 1482 | i->gcmarkbit = 1; |
| @@ -1503,8 +1488,7 @@ mark_interval (i, dummy) | |||
| 1503 | use the macro MARK_INTERVAL_TREE instead. */ | 1488 | use the macro MARK_INTERVAL_TREE instead. */ |
| 1504 | 1489 | ||
| 1505 | static void | 1490 | static void |
| 1506 | mark_interval_tree (tree) | 1491 | mark_interval_tree (register INTERVAL tree) |
| 1507 | register INTERVAL tree; | ||
| 1508 | { | 1492 | { |
| 1509 | /* No need to test if this tree has been marked already; this | 1493 | /* No need to test if this tree has been marked already; this |
| 1510 | function is always called through the MARK_INTERVAL_TREE macro, | 1494 | function is always called through the MARK_INTERVAL_TREE macro, |
| @@ -1751,7 +1735,7 @@ static char string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] = | |||
| 1751 | /* Initialize string allocation. Called from init_alloc_once. */ | 1735 | /* Initialize string allocation. Called from init_alloc_once. */ |
| 1752 | 1736 | ||
| 1753 | static void | 1737 | static void |
| 1754 | init_strings () | 1738 | init_strings (void) |
| 1755 | { | 1739 | { |
| 1756 | total_strings = total_free_strings = total_string_size = 0; | 1740 | total_strings = total_free_strings = total_string_size = 0; |
| 1757 | oldest_sblock = current_sblock = large_sblocks = NULL; | 1741 | oldest_sblock = current_sblock = large_sblocks = NULL; |
| @@ -1873,7 +1857,7 @@ check_string_free_list () | |||
| 1873 | /* Return a new Lisp_String. */ | 1857 | /* Return a new Lisp_String. */ |
| 1874 | 1858 | ||
| 1875 | static struct Lisp_String * | 1859 | static struct Lisp_String * |
| 1876 | allocate_string () | 1860 | allocate_string (void) |
| 1877 | { | 1861 | { |
| 1878 | struct Lisp_String *s; | 1862 | struct Lisp_String *s; |
| 1879 | 1863 | ||
| @@ -1944,9 +1928,7 @@ allocate_string () | |||
| 1944 | S->data if it was initially non-null. */ | 1928 | S->data if it was initially non-null. */ |
| 1945 | 1929 | ||
| 1946 | void | 1930 | void |
| 1947 | allocate_string_data (s, nchars, nbytes) | 1931 | allocate_string_data (struct Lisp_String *s, int nchars, int nbytes) |
| 1948 | struct Lisp_String *s; | ||
| 1949 | int nchars, nbytes; | ||
| 1950 | { | 1932 | { |
| 1951 | struct sdata *data, *old_data; | 1933 | struct sdata *data, *old_data; |
| 1952 | struct sblock *b; | 1934 | struct sblock *b; |
| @@ -2043,7 +2025,7 @@ allocate_string_data (s, nchars, nbytes) | |||
| 2043 | /* Sweep and compact strings. */ | 2025 | /* Sweep and compact strings. */ |
| 2044 | 2026 | ||
| 2045 | static void | 2027 | static void |
| 2046 | sweep_strings () | 2028 | sweep_strings (void) |
| 2047 | { | 2029 | { |
| 2048 | struct string_block *b, *next; | 2030 | struct string_block *b, *next; |
| 2049 | struct string_block *live_blocks = NULL; | 2031 | struct string_block *live_blocks = NULL; |
| @@ -2143,7 +2125,7 @@ sweep_strings () | |||
| 2143 | /* Free dead large strings. */ | 2125 | /* Free dead large strings. */ |
| 2144 | 2126 | ||
| 2145 | static void | 2127 | static void |
| 2146 | free_large_strings () | 2128 | free_large_strings (void) |
| 2147 | { | 2129 | { |
| 2148 | struct sblock *b, *next; | 2130 | struct sblock *b, *next; |
| 2149 | struct sblock *live_blocks = NULL; | 2131 | struct sblock *live_blocks = NULL; |
| @@ -2169,7 +2151,7 @@ free_large_strings () | |||
| 2169 | data of live strings after compaction. */ | 2151 | data of live strings after compaction. */ |
| 2170 | 2152 | ||
| 2171 | static void | 2153 | static void |
| 2172 | compact_small_strings () | 2154 | compact_small_strings (void) |
| 2173 | { | 2155 | { |
| 2174 | struct sblock *b, *tb, *next; | 2156 | struct sblock *b, *tb, *next; |
| 2175 | struct sdata *from, *to, *end, *tb_end; | 2157 | struct sdata *from, *to, *end, *tb_end; |
| @@ -2357,9 +2339,7 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) | |||
| 2357 | multibyte, depending on the contents. */ | 2339 | multibyte, depending on the contents. */ |
| 2358 | 2340 | ||
| 2359 | Lisp_Object | 2341 | Lisp_Object |
| 2360 | make_string (contents, nbytes) | 2342 | make_string (const char *contents, int nbytes) |
| 2361 | const char *contents; | ||
| 2362 | int nbytes; | ||
| 2363 | { | 2343 | { |
| 2364 | register Lisp_Object val; | 2344 | register Lisp_Object val; |
| 2365 | int nchars, multibyte_nbytes; | 2345 | int nchars, multibyte_nbytes; |
| @@ -2378,9 +2358,7 @@ make_string (contents, nbytes) | |||
| 2378 | /* Make an unibyte string from LENGTH bytes at CONTENTS. */ | 2358 | /* Make an unibyte string from LENGTH bytes at CONTENTS. */ |
| 2379 | 2359 | ||
| 2380 | Lisp_Object | 2360 | Lisp_Object |
| 2381 | make_unibyte_string (contents, length) | 2361 | make_unibyte_string (const char *contents, int length) |
| 2382 | const char *contents; | ||
| 2383 | int length; | ||
| 2384 | { | 2362 | { |
| 2385 | register Lisp_Object val; | 2363 | register Lisp_Object val; |
| 2386 | val = make_uninit_string (length); | 2364 | val = make_uninit_string (length); |
| @@ -2394,9 +2372,7 @@ make_unibyte_string (contents, length) | |||
| 2394 | bytes at CONTENTS. */ | 2372 | bytes at CONTENTS. */ |
| 2395 | 2373 | ||
| 2396 | Lisp_Object | 2374 | Lisp_Object |
| 2397 | make_multibyte_string (contents, nchars, nbytes) | 2375 | make_multibyte_string (const char *contents, int nchars, int nbytes) |
| 2398 | const char *contents; | ||
| 2399 | int nchars, nbytes; | ||
| 2400 | { | 2376 | { |
| 2401 | register Lisp_Object val; | 2377 | register Lisp_Object val; |
| 2402 | val = make_uninit_multibyte_string (nchars, nbytes); | 2378 | val = make_uninit_multibyte_string (nchars, nbytes); |
| @@ -2409,9 +2385,7 @@ make_multibyte_string (contents, nchars, nbytes) | |||
| 2409 | CONTENTS. It is a multibyte string if NBYTES != NCHARS. */ | 2385 | CONTENTS. It is a multibyte string if NBYTES != NCHARS. */ |
| 2410 | 2386 | ||
| 2411 | Lisp_Object | 2387 | Lisp_Object |
| 2412 | make_string_from_bytes (contents, nchars, nbytes) | 2388 | make_string_from_bytes (const char *contents, int nchars, int nbytes) |
| 2413 | const char *contents; | ||
| 2414 | int nchars, nbytes; | ||
| 2415 | { | 2389 | { |
| 2416 | register Lisp_Object val; | 2390 | register Lisp_Object val; |
| 2417 | val = make_uninit_multibyte_string (nchars, nbytes); | 2391 | val = make_uninit_multibyte_string (nchars, nbytes); |
| @@ -2428,10 +2402,7 @@ make_string_from_bytes (contents, nchars, nbytes) | |||
| 2428 | characters by itself. */ | 2402 | characters by itself. */ |
| 2429 | 2403 | ||
| 2430 | Lisp_Object | 2404 | Lisp_Object |
| 2431 | make_specified_string (contents, nchars, nbytes, multibyte) | 2405 | make_specified_string (const char *contents, int nchars, int nbytes, int multibyte) |
| 2432 | const char *contents; | ||
| 2433 | int nchars, nbytes; | ||
| 2434 | int multibyte; | ||
| 2435 | { | 2406 | { |
| 2436 | register Lisp_Object val; | 2407 | register Lisp_Object val; |
| 2437 | 2408 | ||
| @@ -2454,8 +2425,7 @@ make_specified_string (contents, nchars, nbytes, multibyte) | |||
| 2454 | data warrants. */ | 2425 | data warrants. */ |
| 2455 | 2426 | ||
| 2456 | Lisp_Object | 2427 | Lisp_Object |
| 2457 | build_string (str) | 2428 | build_string (const char *str) |
| 2458 | const char *str; | ||
| 2459 | { | 2429 | { |
| 2460 | return make_string (str, strlen (str)); | 2430 | return make_string (str, strlen (str)); |
| 2461 | } | 2431 | } |
| @@ -2465,8 +2435,7 @@ build_string (str) | |||
| 2465 | occupying LENGTH bytes. */ | 2435 | occupying LENGTH bytes. */ |
| 2466 | 2436 | ||
| 2467 | Lisp_Object | 2437 | Lisp_Object |
| 2468 | make_uninit_string (length) | 2438 | make_uninit_string (int length) |
| 2469 | int length; | ||
| 2470 | { | 2439 | { |
| 2471 | Lisp_Object val; | 2440 | Lisp_Object val; |
| 2472 | 2441 | ||
| @@ -2482,8 +2451,7 @@ make_uninit_string (length) | |||
| 2482 | which occupy NBYTES bytes. */ | 2451 | which occupy NBYTES bytes. */ |
| 2483 | 2452 | ||
| 2484 | Lisp_Object | 2453 | Lisp_Object |
| 2485 | make_uninit_multibyte_string (nchars, nbytes) | 2454 | make_uninit_multibyte_string (int nchars, int nbytes) |
| 2486 | int nchars, nbytes; | ||
| 2487 | { | 2455 | { |
| 2488 | Lisp_Object string; | 2456 | Lisp_Object string; |
| 2489 | struct Lisp_String *s; | 2457 | struct Lisp_String *s; |
| @@ -2573,7 +2541,7 @@ struct Lisp_Float *float_free_list; | |||
| 2573 | /* Initialize float allocation. */ | 2541 | /* Initialize float allocation. */ |
| 2574 | 2542 | ||
| 2575 | static void | 2543 | static void |
| 2576 | init_float () | 2544 | init_float (void) |
| 2577 | { | 2545 | { |
| 2578 | float_block = NULL; | 2546 | float_block = NULL; |
| 2579 | float_block_index = FLOAT_BLOCK_SIZE; /* Force alloc of new float_block. */ | 2547 | float_block_index = FLOAT_BLOCK_SIZE; /* Force alloc of new float_block. */ |
| @@ -2585,8 +2553,7 @@ init_float () | |||
| 2585 | /* Explicitly free a float cell by putting it on the free-list. */ | 2553 | /* Explicitly free a float cell by putting it on the free-list. */ |
| 2586 | 2554 | ||
| 2587 | static void | 2555 | static void |
| 2588 | free_float (ptr) | 2556 | free_float (struct Lisp_Float *ptr) |
| 2589 | struct Lisp_Float *ptr; | ||
| 2590 | { | 2557 | { |
| 2591 | ptr->u.chain = float_free_list; | 2558 | ptr->u.chain = float_free_list; |
| 2592 | float_free_list = ptr; | 2559 | float_free_list = ptr; |
| @@ -2596,8 +2563,7 @@ free_float (ptr) | |||
| 2596 | /* Return a new float object with value FLOAT_VALUE. */ | 2563 | /* Return a new float object with value FLOAT_VALUE. */ |
| 2597 | 2564 | ||
| 2598 | Lisp_Object | 2565 | Lisp_Object |
| 2599 | make_float (float_value) | 2566 | make_float (double float_value) |
| 2600 | double float_value; | ||
| 2601 | { | 2567 | { |
| 2602 | register Lisp_Object val; | 2568 | register Lisp_Object val; |
| 2603 | 2569 | ||
| @@ -2697,7 +2663,7 @@ static int n_cons_blocks; | |||
| 2697 | /* Initialize cons allocation. */ | 2663 | /* Initialize cons allocation. */ |
| 2698 | 2664 | ||
| 2699 | static void | 2665 | static void |
| 2700 | init_cons () | 2666 | init_cons (void) |
| 2701 | { | 2667 | { |
| 2702 | cons_block = NULL; | 2668 | cons_block = NULL; |
| 2703 | cons_block_index = CONS_BLOCK_SIZE; /* Force alloc of new cons_block. */ | 2669 | cons_block_index = CONS_BLOCK_SIZE; /* Force alloc of new cons_block. */ |
| @@ -2709,8 +2675,7 @@ init_cons () | |||
| 2709 | /* Explicitly free a cons cell by putting it on the free-list. */ | 2675 | /* Explicitly free a cons cell by putting it on the free-list. */ |
| 2710 | 2676 | ||
| 2711 | void | 2677 | void |
| 2712 | free_cons (ptr) | 2678 | free_cons (struct Lisp_Cons *ptr) |
| 2713 | struct Lisp_Cons *ptr; | ||
| 2714 | { | 2679 | { |
| 2715 | ptr->u.chain = cons_free_list; | 2680 | ptr->u.chain = cons_free_list; |
| 2716 | #if GC_MARK_STACK | 2681 | #if GC_MARK_STACK |
| @@ -2766,7 +2731,7 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, | |||
| 2766 | 2731 | ||
| 2767 | /* Get an error now if there's any junk in the cons free list. */ | 2732 | /* Get an error now if there's any junk in the cons free list. */ |
| 2768 | void | 2733 | void |
| 2769 | check_cons_list () | 2734 | check_cons_list (void) |
| 2770 | { | 2735 | { |
| 2771 | #ifdef GC_CHECK_CONS_LIST | 2736 | #ifdef GC_CHECK_CONS_LIST |
| 2772 | struct Lisp_Cons *tail = cons_free_list; | 2737 | struct Lisp_Cons *tail = cons_free_list; |
| @@ -2779,39 +2744,34 @@ check_cons_list () | |||
| 2779 | /* Make a list of 1, 2, 3, 4 or 5 specified objects. */ | 2744 | /* Make a list of 1, 2, 3, 4 or 5 specified objects. */ |
| 2780 | 2745 | ||
| 2781 | Lisp_Object | 2746 | Lisp_Object |
| 2782 | list1 (arg1) | 2747 | list1 (Lisp_Object arg1) |
| 2783 | Lisp_Object arg1; | ||
| 2784 | { | 2748 | { |
| 2785 | return Fcons (arg1, Qnil); | 2749 | return Fcons (arg1, Qnil); |
| 2786 | } | 2750 | } |
| 2787 | 2751 | ||
| 2788 | Lisp_Object | 2752 | Lisp_Object |
| 2789 | list2 (arg1, arg2) | 2753 | list2 (Lisp_Object arg1, Lisp_Object arg2) |
| 2790 | Lisp_Object arg1, arg2; | ||
| 2791 | { | 2754 | { |
| 2792 | return Fcons (arg1, Fcons (arg2, Qnil)); | 2755 | return Fcons (arg1, Fcons (arg2, Qnil)); |
| 2793 | } | 2756 | } |
| 2794 | 2757 | ||
| 2795 | 2758 | ||
| 2796 | Lisp_Object | 2759 | Lisp_Object |
| 2797 | list3 (arg1, arg2, arg3) | 2760 | list3 (Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) |
| 2798 | Lisp_Object arg1, arg2, arg3; | ||
| 2799 | { | 2761 | { |
| 2800 | return Fcons (arg1, Fcons (arg2, Fcons (arg3, Qnil))); | 2762 | return Fcons (arg1, Fcons (arg2, Fcons (arg3, Qnil))); |
| 2801 | } | 2763 | } |
| 2802 | 2764 | ||
| 2803 | 2765 | ||
| 2804 | Lisp_Object | 2766 | Lisp_Object |
| 2805 | list4 (arg1, arg2, arg3, arg4) | 2767 | list4 (Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4) |
| 2806 | Lisp_Object arg1, arg2, arg3, arg4; | ||
| 2807 | { | 2768 | { |
| 2808 | return Fcons (arg1, Fcons (arg2, Fcons (arg3, Fcons (arg4, Qnil)))); | 2769 | return Fcons (arg1, Fcons (arg2, Fcons (arg3, Fcons (arg4, Qnil)))); |
| 2809 | } | 2770 | } |
| 2810 | 2771 | ||
| 2811 | 2772 | ||
| 2812 | Lisp_Object | 2773 | Lisp_Object |
| 2813 | list5 (arg1, arg2, arg3, arg4, arg5) | 2774 | list5 (Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3, Lisp_Object arg4, Lisp_Object arg5) |
| 2814 | Lisp_Object arg1, arg2, arg3, arg4, arg5; | ||
| 2815 | { | 2775 | { |
| 2816 | return Fcons (arg1, Fcons (arg2, Fcons (arg3, Fcons (arg4, | 2776 | return Fcons (arg1, Fcons (arg2, Fcons (arg3, Fcons (arg4, |
| 2817 | Fcons (arg5, Qnil))))); | 2777 | Fcons (arg5, Qnil))))); |
| @@ -2904,8 +2864,7 @@ static int n_vectors; | |||
| 2904 | with room for LEN Lisp_Objects. */ | 2864 | with room for LEN Lisp_Objects. */ |
| 2905 | 2865 | ||
| 2906 | static struct Lisp_Vector * | 2866 | static struct Lisp_Vector * |
| 2907 | allocate_vectorlike (len) | 2867 | allocate_vectorlike (EMACS_INT len) |
| 2908 | EMACS_INT len; | ||
| 2909 | { | 2868 | { |
| 2910 | struct Lisp_Vector *p; | 2869 | struct Lisp_Vector *p; |
| 2911 | size_t nbytes; | 2870 | size_t nbytes; |
| @@ -2946,8 +2905,7 @@ allocate_vectorlike (len) | |||
| 2946 | /* Allocate a vector with NSLOTS slots. */ | 2905 | /* Allocate a vector with NSLOTS slots. */ |
| 2947 | 2906 | ||
| 2948 | struct Lisp_Vector * | 2907 | struct Lisp_Vector * |
| 2949 | allocate_vector (nslots) | 2908 | allocate_vector (EMACS_INT nslots) |
| 2950 | EMACS_INT nslots; | ||
| 2951 | { | 2909 | { |
| 2952 | struct Lisp_Vector *v = allocate_vectorlike (nslots); | 2910 | struct Lisp_Vector *v = allocate_vectorlike (nslots); |
| 2953 | v->size = nslots; | 2911 | v->size = nslots; |
| @@ -2958,9 +2916,7 @@ allocate_vector (nslots) | |||
| 2958 | /* Allocate other vector-like structures. */ | 2916 | /* Allocate other vector-like structures. */ |
| 2959 | 2917 | ||
| 2960 | struct Lisp_Vector * | 2918 | struct Lisp_Vector * |
| 2961 | allocate_pseudovector (memlen, lisplen, tag) | 2919 | allocate_pseudovector (int memlen, int lisplen, EMACS_INT tag) |
| 2962 | int memlen, lisplen; | ||
| 2963 | EMACS_INT tag; | ||
| 2964 | { | 2920 | { |
| 2965 | struct Lisp_Vector *v = allocate_vectorlike (memlen); | 2921 | struct Lisp_Vector *v = allocate_vectorlike (memlen); |
| 2966 | EMACS_INT i; | 2922 | EMACS_INT i; |
| @@ -2982,14 +2938,14 @@ allocate_hash_table (void) | |||
| 2982 | 2938 | ||
| 2983 | 2939 | ||
| 2984 | struct window * | 2940 | struct window * |
| 2985 | allocate_window () | 2941 | allocate_window (void) |
| 2986 | { | 2942 | { |
| 2987 | return ALLOCATE_PSEUDOVECTOR(struct window, current_matrix, PVEC_WINDOW); | 2943 | return ALLOCATE_PSEUDOVECTOR(struct window, current_matrix, PVEC_WINDOW); |
| 2988 | } | 2944 | } |
| 2989 | 2945 | ||
| 2990 | 2946 | ||
| 2991 | struct terminal * | 2947 | struct terminal * |
| 2992 | allocate_terminal () | 2948 | allocate_terminal (void) |
| 2993 | { | 2949 | { |
| 2994 | struct terminal *t = ALLOCATE_PSEUDOVECTOR (struct terminal, | 2950 | struct terminal *t = ALLOCATE_PSEUDOVECTOR (struct terminal, |
| 2995 | next_terminal, PVEC_TERMINAL); | 2951 | next_terminal, PVEC_TERMINAL); |
| @@ -3001,7 +2957,7 @@ allocate_terminal () | |||
| 3001 | } | 2957 | } |
| 3002 | 2958 | ||
| 3003 | struct frame * | 2959 | struct frame * |
| 3004 | allocate_frame () | 2960 | allocate_frame (void) |
| 3005 | { | 2961 | { |
| 3006 | struct frame *f = ALLOCATE_PSEUDOVECTOR (struct frame, | 2962 | struct frame *f = ALLOCATE_PSEUDOVECTOR (struct frame, |
| 3007 | face_cache, PVEC_FRAME); | 2963 | face_cache, PVEC_FRAME); |
| @@ -3013,7 +2969,7 @@ allocate_frame () | |||
| 3013 | 2969 | ||
| 3014 | 2970 | ||
| 3015 | struct Lisp_Process * | 2971 | struct Lisp_Process * |
| 3016 | allocate_process () | 2972 | allocate_process (void) |
| 3017 | { | 2973 | { |
| 3018 | return ALLOCATE_PSEUDOVECTOR (struct Lisp_Process, pid, PVEC_PROCESS); | 2974 | return ALLOCATE_PSEUDOVECTOR (struct Lisp_Process, pid, PVEC_PROCESS); |
| 3019 | } | 2975 | } |
| @@ -3142,7 +3098,7 @@ static int n_symbol_blocks; | |||
| 3142 | /* Initialize symbol allocation. */ | 3098 | /* Initialize symbol allocation. */ |
| 3143 | 3099 | ||
| 3144 | static void | 3100 | static void |
| 3145 | init_symbol () | 3101 | init_symbol (void) |
| 3146 | { | 3102 | { |
| 3147 | symbol_block = NULL; | 3103 | symbol_block = NULL; |
| 3148 | symbol_block_index = SYMBOL_BLOCK_SIZE; | 3104 | symbol_block_index = SYMBOL_BLOCK_SIZE; |
| @@ -3233,7 +3189,7 @@ static union Lisp_Misc *marker_free_list; | |||
| 3233 | static int n_marker_blocks; | 3189 | static int n_marker_blocks; |
| 3234 | 3190 | ||
| 3235 | static void | 3191 | static void |
| 3236 | init_marker () | 3192 | init_marker (void) |
| 3237 | { | 3193 | { |
| 3238 | marker_block = NULL; | 3194 | marker_block = NULL; |
| 3239 | marker_block_index = MARKER_BLOCK_SIZE; | 3195 | marker_block_index = MARKER_BLOCK_SIZE; |
| @@ -3244,7 +3200,7 @@ init_marker () | |||
| 3244 | /* Return a newly allocated Lisp_Misc object, with no substructure. */ | 3200 | /* Return a newly allocated Lisp_Misc object, with no substructure. */ |
| 3245 | 3201 | ||
| 3246 | Lisp_Object | 3202 | Lisp_Object |
| 3247 | allocate_misc () | 3203 | allocate_misc (void) |
| 3248 | { | 3204 | { |
| 3249 | Lisp_Object val; | 3205 | Lisp_Object val; |
| 3250 | 3206 | ||
| @@ -3286,8 +3242,7 @@ allocate_misc () | |||
| 3286 | /* Free a Lisp_Misc object */ | 3242 | /* Free a Lisp_Misc object */ |
| 3287 | 3243 | ||
| 3288 | void | 3244 | void |
| 3289 | free_misc (misc) | 3245 | free_misc (Lisp_Object misc) |
| 3290 | Lisp_Object misc; | ||
| 3291 | { | 3246 | { |
| 3292 | XMISCTYPE (misc) = Lisp_Misc_Free; | 3247 | XMISCTYPE (misc) = Lisp_Misc_Free; |
| 3293 | XMISC (misc)->u_free.chain = marker_free_list; | 3248 | XMISC (misc)->u_free.chain = marker_free_list; |
| @@ -3301,9 +3256,7 @@ free_misc (misc) | |||
| 3301 | The unwind function can get the C values back using XSAVE_VALUE. */ | 3256 | The unwind function can get the C values back using XSAVE_VALUE. */ |
| 3302 | 3257 | ||
| 3303 | Lisp_Object | 3258 | Lisp_Object |
| 3304 | make_save_value (pointer, integer) | 3259 | make_save_value (void *pointer, int integer) |
| 3305 | void *pointer; | ||
| 3306 | int integer; | ||
| 3307 | { | 3260 | { |
| 3308 | register Lisp_Object val; | 3261 | register Lisp_Object val; |
| 3309 | register struct Lisp_Save_Value *p; | 3262 | register struct Lisp_Save_Value *p; |
| @@ -3338,8 +3291,7 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, | |||
| 3338 | /* Put MARKER back on the free list after using it temporarily. */ | 3291 | /* Put MARKER back on the free list after using it temporarily. */ |
| 3339 | 3292 | ||
| 3340 | void | 3293 | void |
| 3341 | free_marker (marker) | 3294 | free_marker (Lisp_Object marker) |
| 3342 | Lisp_Object marker; | ||
| 3343 | { | 3295 | { |
| 3344 | unchain_marker (XMARKER (marker)); | 3296 | unchain_marker (XMARKER (marker)); |
| 3345 | free_misc (marker); | 3297 | free_misc (marker); |
| @@ -3353,9 +3305,7 @@ free_marker (marker) | |||
| 3353 | Any number of arguments, even zero arguments, are allowed. */ | 3305 | Any number of arguments, even zero arguments, are allowed. */ |
| 3354 | 3306 | ||
| 3355 | Lisp_Object | 3307 | Lisp_Object |
| 3356 | make_event_array (nargs, args) | 3308 | make_event_array (register int nargs, Lisp_Object *args) |
| 3357 | register int nargs; | ||
| 3358 | Lisp_Object *args; | ||
| 3359 | { | 3309 | { |
| 3360 | int i; | 3310 | int i; |
| 3361 | 3311 | ||
| @@ -3395,7 +3345,7 @@ make_event_array (nargs, args) | |||
| 3395 | /* Called if malloc returns zero. */ | 3345 | /* Called if malloc returns zero. */ |
| 3396 | 3346 | ||
| 3397 | void | 3347 | void |
| 3398 | memory_full () | 3348 | memory_full (void) |
| 3399 | { | 3349 | { |
| 3400 | int i; | 3350 | int i; |
| 3401 | 3351 | ||
| @@ -3435,7 +3385,7 @@ memory_full () | |||
| 3435 | and also directly from this file, in case we're not using ralloc.c. */ | 3385 | and also directly from this file, in case we're not using ralloc.c. */ |
| 3436 | 3386 | ||
| 3437 | void | 3387 | void |
| 3438 | refill_memory_reserve () | 3388 | refill_memory_reserve (void) |
| 3439 | { | 3389 | { |
| 3440 | #ifndef SYSTEM_MALLOC | 3390 | #ifndef SYSTEM_MALLOC |
| 3441 | if (spare_memory[0] == 0) | 3391 | if (spare_memory[0] == 0) |
| @@ -3483,7 +3433,7 @@ refill_memory_reserve () | |||
| 3483 | /* Initialize this part of alloc.c. */ | 3433 | /* Initialize this part of alloc.c. */ |
| 3484 | 3434 | ||
| 3485 | static void | 3435 | static void |
| 3486 | mem_init () | 3436 | mem_init (void) |
| 3487 | { | 3437 | { |
| 3488 | mem_z.left = mem_z.right = MEM_NIL; | 3438 | mem_z.left = mem_z.right = MEM_NIL; |
| 3489 | mem_z.parent = NULL; | 3439 | mem_z.parent = NULL; |
| @@ -3497,8 +3447,7 @@ mem_init () | |||
| 3497 | MEM_NIL if there is no node in the tree containing START. */ | 3447 | MEM_NIL if there is no node in the tree containing START. */ |
| 3498 | 3448 | ||
| 3499 | static INLINE struct mem_node * | 3449 | static INLINE struct mem_node * |
| 3500 | mem_find (start) | 3450 | mem_find (void *start) |
| 3501 | void *start; | ||
| 3502 | { | 3451 | { |
| 3503 | struct mem_node *p; | 3452 | struct mem_node *p; |
| 3504 | 3453 | ||
| @@ -3521,9 +3470,7 @@ mem_find (start) | |||
| 3521 | pointer to the node that was inserted. */ | 3470 | pointer to the node that was inserted. */ |
| 3522 | 3471 | ||
| 3523 | static struct mem_node * | 3472 | static struct mem_node * |
| 3524 | mem_insert (start, end, type) | 3473 | mem_insert (void *start, void *end, enum mem_type type) |
| 3525 | void *start, *end; | ||
| 3526 | enum mem_type type; | ||
| 3527 | { | 3474 | { |
| 3528 | struct mem_node *c, *parent, *x; | 3475 | struct mem_node *c, *parent, *x; |
| 3529 | 3476 | ||
| @@ -3595,8 +3542,7 @@ mem_insert (start, end, type) | |||
| 3595 | balance the tree, after node X has been inserted; X is always red. */ | 3542 | balance the tree, after node X has been inserted; X is always red. */ |
| 3596 | 3543 | ||
| 3597 | static void | 3544 | static void |
| 3598 | mem_insert_fixup (x) | 3545 | mem_insert_fixup (struct mem_node *x) |
| 3599 | struct mem_node *x; | ||
| 3600 | { | 3546 | { |
| 3601 | while (x != mem_root && x->parent->color == MEM_RED) | 3547 | while (x != mem_root && x->parent->color == MEM_RED) |
| 3602 | { | 3548 | { |
| @@ -3674,8 +3620,7 @@ mem_insert_fixup (x) | |||
| 3674 | b c a b */ | 3620 | b c a b */ |
| 3675 | 3621 | ||
| 3676 | static void | 3622 | static void |
| 3677 | mem_rotate_left (x) | 3623 | mem_rotate_left (struct mem_node *x) |
| 3678 | struct mem_node *x; | ||
| 3679 | { | 3624 | { |
| 3680 | struct mem_node *y; | 3625 | struct mem_node *y; |
| 3681 | 3626 | ||
| @@ -3714,8 +3659,7 @@ mem_rotate_left (x) | |||
| 3714 | a b b c */ | 3659 | a b b c */ |
| 3715 | 3660 | ||
| 3716 | static void | 3661 | static void |
| 3717 | mem_rotate_right (x) | 3662 | mem_rotate_right (struct mem_node *x) |
| 3718 | struct mem_node *x; | ||
| 3719 | { | 3663 | { |
| 3720 | struct mem_node *y = x->left; | 3664 | struct mem_node *y = x->left; |
| 3721 | 3665 | ||
| @@ -3744,8 +3688,7 @@ mem_rotate_right (x) | |||
| 3744 | /* Delete node Z from the tree. If Z is null or MEM_NIL, do nothing. */ | 3688 | /* Delete node Z from the tree. If Z is null or MEM_NIL, do nothing. */ |
| 3745 | 3689 | ||
| 3746 | static void | 3690 | static void |
| 3747 | mem_delete (z) | 3691 | mem_delete (struct mem_node *z) |
| 3748 | struct mem_node *z; | ||
| 3749 | { | 3692 | { |
| 3750 | struct mem_node *x, *y; | 3693 | struct mem_node *x, *y; |
| 3751 | 3694 | ||
| @@ -3799,8 +3742,7 @@ mem_delete (z) | |||
| 3799 | deletion. */ | 3742 | deletion. */ |
| 3800 | 3743 | ||
| 3801 | static void | 3744 | static void |
| 3802 | mem_delete_fixup (x) | 3745 | mem_delete_fixup (struct mem_node *x) |
| 3803 | struct mem_node *x; | ||
| 3804 | { | 3746 | { |
| 3805 | while (x != mem_root && x->color == MEM_BLACK) | 3747 | while (x != mem_root && x->color == MEM_BLACK) |
| 3806 | { | 3748 | { |
| @@ -3881,9 +3823,7 @@ mem_delete_fixup (x) | |||
| 3881 | the heap. M is a pointer to the mem_block for P. */ | 3823 | the heap. M is a pointer to the mem_block for P. */ |
| 3882 | 3824 | ||
| 3883 | static INLINE int | 3825 | static INLINE int |
| 3884 | live_string_p (m, p) | 3826 | live_string_p (struct mem_node *m, void *p) |
| 3885 | struct mem_node *m; | ||
| 3886 | void *p; | ||
| 3887 | { | 3827 | { |
| 3888 | if (m->type == MEM_TYPE_STRING) | 3828 | if (m->type == MEM_TYPE_STRING) |
| 3889 | { | 3829 | { |
| @@ -3906,9 +3846,7 @@ live_string_p (m, p) | |||
| 3906 | the heap. M is a pointer to the mem_block for P. */ | 3846 | the heap. M is a pointer to the mem_block for P. */ |
| 3907 | 3847 | ||
| 3908 | static INLINE int | 3848 | static INLINE int |
| 3909 | live_cons_p (m, p) | 3849 | live_cons_p (struct mem_node *m, void *p) |
| 3910 | struct mem_node *m; | ||
| 3911 | void *p; | ||
| 3912 | { | 3850 | { |
| 3913 | if (m->type == MEM_TYPE_CONS) | 3851 | if (m->type == MEM_TYPE_CONS) |
| 3914 | { | 3852 | { |
| @@ -3934,9 +3872,7 @@ live_cons_p (m, p) | |||
| 3934 | the heap. M is a pointer to the mem_block for P. */ | 3872 | the heap. M is a pointer to the mem_block for P. */ |
| 3935 | 3873 | ||
| 3936 | static INLINE int | 3874 | static INLINE int |
| 3937 | live_symbol_p (m, p) | 3875 | live_symbol_p (struct mem_node *m, void *p) |
| 3938 | struct mem_node *m; | ||
| 3939 | void *p; | ||
| 3940 | { | 3876 | { |
| 3941 | if (m->type == MEM_TYPE_SYMBOL) | 3877 | if (m->type == MEM_TYPE_SYMBOL) |
| 3942 | { | 3878 | { |
| @@ -3962,9 +3898,7 @@ live_symbol_p (m, p) | |||
| 3962 | the heap. M is a pointer to the mem_block for P. */ | 3898 | the heap. M is a pointer to the mem_block for P. */ |
| 3963 | 3899 | ||
| 3964 | static INLINE int | 3900 | static INLINE int |
| 3965 | live_float_p (m, p) | 3901 | live_float_p (struct mem_node *m, void *p) |
| 3966 | struct mem_node *m; | ||
| 3967 | void *p; | ||
| 3968 | { | 3902 | { |
| 3969 | if (m->type == MEM_TYPE_FLOAT) | 3903 | if (m->type == MEM_TYPE_FLOAT) |
| 3970 | { | 3904 | { |
| @@ -3988,9 +3922,7 @@ live_float_p (m, p) | |||
| 3988 | the heap. M is a pointer to the mem_block for P. */ | 3922 | the heap. M is a pointer to the mem_block for P. */ |
| 3989 | 3923 | ||
| 3990 | static INLINE int | 3924 | static INLINE int |
| 3991 | live_misc_p (m, p) | 3925 | live_misc_p (struct mem_node *m, void *p) |
| 3992 | struct mem_node *m; | ||
| 3993 | void *p; | ||
| 3994 | { | 3926 | { |
| 3995 | if (m->type == MEM_TYPE_MISC) | 3927 | if (m->type == MEM_TYPE_MISC) |
| 3996 | { | 3928 | { |
| @@ -4016,9 +3948,7 @@ live_misc_p (m, p) | |||
| 4016 | M is a pointer to the mem_block for P. */ | 3948 | M is a pointer to the mem_block for P. */ |
| 4017 | 3949 | ||
| 4018 | static INLINE int | 3950 | static INLINE int |
| 4019 | live_vector_p (m, p) | 3951 | live_vector_p (struct mem_node *m, void *p) |
| 4020 | struct mem_node *m; | ||
| 4021 | void *p; | ||
| 4022 | { | 3952 | { |
| 4023 | return (p == m->start && m->type == MEM_TYPE_VECTORLIKE); | 3953 | return (p == m->start && m->type == MEM_TYPE_VECTORLIKE); |
| 4024 | } | 3954 | } |
| @@ -4028,9 +3958,7 @@ live_vector_p (m, p) | |||
| 4028 | pointer to the mem_block for P. */ | 3958 | pointer to the mem_block for P. */ |
| 4029 | 3959 | ||
| 4030 | static INLINE int | 3960 | static INLINE int |
| 4031 | live_buffer_p (m, p) | 3961 | live_buffer_p (struct mem_node *m, void *p) |
| 4032 | struct mem_node *m; | ||
| 4033 | void *p; | ||
| 4034 | { | 3962 | { |
| 4035 | /* P must point to the start of the block, and the buffer | 3963 | /* P must point to the start of the block, and the buffer |
| 4036 | must not have been killed. */ | 3964 | must not have been killed. */ |
| @@ -4096,8 +4024,7 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "", | |||
| 4096 | /* Mark OBJ if we can prove it's a Lisp_Object. */ | 4024 | /* Mark OBJ if we can prove it's a Lisp_Object. */ |
| 4097 | 4025 | ||
| 4098 | static INLINE void | 4026 | static INLINE void |
| 4099 | mark_maybe_object (obj) | 4027 | mark_maybe_object (Lisp_Object obj) |
| 4100 | Lisp_Object obj; | ||
| 4101 | { | 4028 | { |
| 4102 | void *po = (void *) XPNTR (obj); | 4029 | void *po = (void *) XPNTR (obj); |
| 4103 | struct mem_node *m = mem_find (po); | 4030 | struct mem_node *m = mem_find (po); |
| @@ -4160,8 +4087,7 @@ mark_maybe_object (obj) | |||
| 4160 | marked. */ | 4087 | marked. */ |
| 4161 | 4088 | ||
| 4162 | static INLINE void | 4089 | static INLINE void |
| 4163 | mark_maybe_pointer (p) | 4090 | mark_maybe_pointer (void *p) |
| 4164 | void *p; | ||
| 4165 | { | 4091 | { |
| 4166 | struct mem_node *m; | 4092 | struct mem_node *m; |
| 4167 | 4093 | ||
| @@ -4241,9 +4167,7 @@ mark_maybe_pointer (p) | |||
| 4241 | or END+OFFSET..START. */ | 4167 | or END+OFFSET..START. */ |
| 4242 | 4168 | ||
| 4243 | static void | 4169 | static void |
| 4244 | mark_memory (start, end, offset) | 4170 | mark_memory (void *start, void *end, int offset) |
| 4245 | void *start, *end; | ||
| 4246 | int offset; | ||
| 4247 | { | 4171 | { |
| 4248 | Lisp_Object *p; | 4172 | Lisp_Object *p; |
| 4249 | void **pp; | 4173 | void **pp; |
| @@ -4459,7 +4383,7 @@ dump_zombies () | |||
| 4459 | equally on the stack. */ | 4383 | equally on the stack. */ |
| 4460 | 4384 | ||
| 4461 | static void | 4385 | static void |
| 4462 | mark_stack () | 4386 | mark_stack (void) |
| 4463 | { | 4387 | { |
| 4464 | int i; | 4388 | int i; |
| 4465 | /* jmp_buf may not be aligned enough on darwin-ppc64 */ | 4389 | /* jmp_buf may not be aligned enough on darwin-ppc64 */ |
| @@ -4534,8 +4458,7 @@ mark_stack () | |||
| 4534 | 4458 | ||
| 4535 | /* Determine whether it is safe to access memory at address P. */ | 4459 | /* Determine whether it is safe to access memory at address P. */ |
| 4536 | static int | 4460 | static int |
| 4537 | valid_pointer_p (p) | 4461 | valid_pointer_p (void *p) |
| 4538 | void *p; | ||
| 4539 | { | 4462 | { |
| 4540 | #ifdef WINDOWSNT | 4463 | #ifdef WINDOWSNT |
| 4541 | return w32_valid_pointer_p (p, 16); | 4464 | return w32_valid_pointer_p (p, 16); |
| @@ -4566,8 +4489,7 @@ valid_pointer_p (p) | |||
| 4566 | so it should only be used in code for manual debugging. */ | 4489 | so it should only be used in code for manual debugging. */ |
| 4567 | 4490 | ||
| 4568 | int | 4491 | int |
| 4569 | valid_lisp_object_p (obj) | 4492 | valid_lisp_object_p (Lisp_Object obj) |
| 4570 | Lisp_Object obj; | ||
| 4571 | { | 4493 | { |
| 4572 | void *p; | 4494 | void *p; |
| 4573 | #if GC_MARK_STACK | 4495 | #if GC_MARK_STACK |
| @@ -4645,9 +4567,7 @@ valid_lisp_object_p (obj) | |||
| 4645 | allocated. TYPE < 0 means it's not used for a Lisp object. */ | 4567 | allocated. TYPE < 0 means it's not used for a Lisp object. */ |
| 4646 | 4568 | ||
| 4647 | static POINTER_TYPE * | 4569 | static POINTER_TYPE * |
| 4648 | pure_alloc (size, type) | 4570 | pure_alloc (size_t size, int type) |
| 4649 | size_t size; | ||
| 4650 | int type; | ||
| 4651 | { | 4571 | { |
| 4652 | POINTER_TYPE *result; | 4572 | POINTER_TYPE *result; |
| 4653 | #ifdef USE_LSB_TAG | 4573 | #ifdef USE_LSB_TAG |
| @@ -4701,7 +4621,7 @@ pure_alloc (size, type) | |||
| 4701 | /* Print a warning if PURESIZE is too small. */ | 4621 | /* Print a warning if PURESIZE is too small. */ |
| 4702 | 4622 | ||
| 4703 | void | 4623 | void |
| 4704 | check_pure_size () | 4624 | check_pure_size (void) |
| 4705 | { | 4625 | { |
| 4706 | if (pure_bytes_used_before_overflow) | 4626 | if (pure_bytes_used_before_overflow) |
| 4707 | message ("emacs:0:Pure Lisp storage overflow (approx. %d bytes needed)", | 4627 | message ("emacs:0:Pure Lisp storage overflow (approx. %d bytes needed)", |
| @@ -4714,9 +4634,7 @@ check_pure_size () | |||
| 4714 | address. Return NULL if not found. */ | 4634 | address. Return NULL if not found. */ |
| 4715 | 4635 | ||
| 4716 | static char * | 4636 | static char * |
| 4717 | find_string_data_in_pure (data, nbytes) | 4637 | find_string_data_in_pure (const char *data, int nbytes) |
| 4718 | const char *data; | ||
| 4719 | int nbytes; | ||
| 4720 | { | 4638 | { |
| 4721 | int i, skip, bm_skip[256], last_char_skip, infinity, start, start_max; | 4639 | int i, skip, bm_skip[256], last_char_skip, infinity, start, start_max; |
| 4722 | const unsigned char *p; | 4640 | const unsigned char *p; |
| @@ -4785,10 +4703,7 @@ find_string_data_in_pure (data, nbytes) | |||
| 4785 | string; then the string is not protected from gc. */ | 4703 | string; then the string is not protected from gc. */ |
| 4786 | 4704 | ||
| 4787 | Lisp_Object | 4705 | Lisp_Object |
| 4788 | make_pure_string (data, nchars, nbytes, multibyte) | 4706 | make_pure_string (const char *data, int nchars, int nbytes, int multibyte) |
| 4789 | const char *data; | ||
| 4790 | int nchars, nbytes; | ||
| 4791 | int multibyte; | ||
| 4792 | { | 4707 | { |
| 4793 | Lisp_Object string; | 4708 | Lisp_Object string; |
| 4794 | struct Lisp_String *s; | 4709 | struct Lisp_String *s; |
| @@ -4831,8 +4746,7 @@ make_pure_c_string (const char *data) | |||
| 4831 | of CAR as car and CDR as cdr. */ | 4746 | of CAR as car and CDR as cdr. */ |
| 4832 | 4747 | ||
| 4833 | Lisp_Object | 4748 | Lisp_Object |
| 4834 | pure_cons (car, cdr) | 4749 | pure_cons (Lisp_Object car, Lisp_Object cdr) |
| 4835 | Lisp_Object car, cdr; | ||
| 4836 | { | 4750 | { |
| 4837 | register Lisp_Object new; | 4751 | register Lisp_Object new; |
| 4838 | struct Lisp_Cons *p; | 4752 | struct Lisp_Cons *p; |
| @@ -4848,8 +4762,7 @@ pure_cons (car, cdr) | |||
| 4848 | /* Value is a float object with value NUM allocated from pure space. */ | 4762 | /* Value is a float object with value NUM allocated from pure space. */ |
| 4849 | 4763 | ||
| 4850 | static Lisp_Object | 4764 | static Lisp_Object |
| 4851 | make_pure_float (num) | 4765 | make_pure_float (double num) |
| 4852 | double num; | ||
| 4853 | { | 4766 | { |
| 4854 | register Lisp_Object new; | 4767 | register Lisp_Object new; |
| 4855 | struct Lisp_Float *p; | 4768 | struct Lisp_Float *p; |
| @@ -4865,8 +4778,7 @@ make_pure_float (num) | |||
| 4865 | pure space. */ | 4778 | pure space. */ |
| 4866 | 4779 | ||
| 4867 | Lisp_Object | 4780 | Lisp_Object |
| 4868 | make_pure_vector (len) | 4781 | make_pure_vector (EMACS_INT len) |
| 4869 | EMACS_INT len; | ||
| 4870 | { | 4782 | { |
| 4871 | Lisp_Object new; | 4783 | Lisp_Object new; |
| 4872 | struct Lisp_Vector *p; | 4784 | struct Lisp_Vector *p; |
| @@ -4949,8 +4861,7 @@ Does not copy symbols. Copies strings without text properties. */) | |||
| 4949 | VARADDRESS. */ | 4861 | VARADDRESS. */ |
| 4950 | 4862 | ||
| 4951 | void | 4863 | void |
| 4952 | staticpro (varaddress) | 4864 | staticpro (Lisp_Object *varaddress) |
| 4953 | Lisp_Object *varaddress; | ||
| 4954 | { | 4865 | { |
| 4955 | staticvec[staticidx++] = varaddress; | 4866 | staticvec[staticidx++] = varaddress; |
| 4956 | if (staticidx >= NSTATICS) | 4867 | if (staticidx >= NSTATICS) |
| @@ -4965,7 +4876,7 @@ staticpro (varaddress) | |||
| 4965 | /* Temporarily prevent garbage collection. */ | 4876 | /* Temporarily prevent garbage collection. */ |
| 4966 | 4877 | ||
| 4967 | int | 4878 | int |
| 4968 | inhibit_garbage_collection () | 4879 | inhibit_garbage_collection (void) |
| 4969 | { | 4880 | { |
| 4970 | int count = SPECPDL_INDEX (); | 4881 | int count = SPECPDL_INDEX (); |
| 4971 | int nbits = min (VALBITS, BITS_PER_INT); | 4882 | int nbits = min (VALBITS, BITS_PER_INT); |
| @@ -5297,8 +5208,7 @@ returns nil, because real GC can't be done. */) | |||
| 5297 | only interesting objects referenced from glyphs are strings. */ | 5208 | only interesting objects referenced from glyphs are strings. */ |
| 5298 | 5209 | ||
| 5299 | static void | 5210 | static void |
| 5300 | mark_glyph_matrix (matrix) | 5211 | mark_glyph_matrix (struct glyph_matrix *matrix) |
| 5301 | struct glyph_matrix *matrix; | ||
| 5302 | { | 5212 | { |
| 5303 | struct glyph_row *row = matrix->rows; | 5213 | struct glyph_row *row = matrix->rows; |
| 5304 | struct glyph_row *end = row + matrix->nrows; | 5214 | struct glyph_row *end = row + matrix->nrows; |
| @@ -5324,8 +5234,7 @@ mark_glyph_matrix (matrix) | |||
| 5324 | /* Mark Lisp faces in the face cache C. */ | 5234 | /* Mark Lisp faces in the face cache C. */ |
| 5325 | 5235 | ||
| 5326 | static void | 5236 | static void |
| 5327 | mark_face_cache (c) | 5237 | mark_face_cache (struct face_cache *c) |
| 5328 | struct face_cache *c; | ||
| 5329 | { | 5238 | { |
| 5330 | if (c) | 5239 | if (c) |
| 5331 | { | 5240 | { |
| @@ -5360,8 +5269,7 @@ int last_marked_index; | |||
| 5360 | static int mark_object_loop_halt; | 5269 | static int mark_object_loop_halt; |
| 5361 | 5270 | ||
| 5362 | static void | 5271 | static void |
| 5363 | mark_vectorlike (ptr) | 5272 | mark_vectorlike (struct Lisp_Vector *ptr) |
| 5364 | struct Lisp_Vector *ptr; | ||
| 5365 | { | 5273 | { |
| 5366 | register EMACS_INT size = ptr->size; | 5274 | register EMACS_INT size = ptr->size; |
| 5367 | register int i; | 5275 | register int i; |
| @@ -5384,8 +5292,7 @@ mark_vectorlike (ptr) | |||
| 5384 | symbols. */ | 5292 | symbols. */ |
| 5385 | 5293 | ||
| 5386 | static void | 5294 | static void |
| 5387 | mark_char_table (ptr) | 5295 | mark_char_table (struct Lisp_Vector *ptr) |
| 5388 | struct Lisp_Vector *ptr; | ||
| 5389 | { | 5296 | { |
| 5390 | register EMACS_INT size = ptr->size & PSEUDOVECTOR_SIZE_MASK; | 5297 | register EMACS_INT size = ptr->size & PSEUDOVECTOR_SIZE_MASK; |
| 5391 | register int i; | 5298 | register int i; |
| @@ -5409,8 +5316,7 @@ mark_char_table (ptr) | |||
| 5409 | } | 5316 | } |
| 5410 | 5317 | ||
| 5411 | void | 5318 | void |
| 5412 | mark_object (arg) | 5319 | mark_object (Lisp_Object arg) |
| 5413 | Lisp_Object arg; | ||
| 5414 | { | 5320 | { |
| 5415 | register Lisp_Object obj = arg; | 5321 | register Lisp_Object obj = arg; |
| 5416 | #ifdef GC_CHECK_MARKED_OBJECTS | 5322 | #ifdef GC_CHECK_MARKED_OBJECTS |
| @@ -5719,8 +5625,7 @@ mark_object (arg) | |||
| 5719 | /* Mark the pointers in a buffer structure. */ | 5625 | /* Mark the pointers in a buffer structure. */ |
| 5720 | 5626 | ||
| 5721 | static void | 5627 | static void |
| 5722 | mark_buffer (buf) | 5628 | mark_buffer (Lisp_Object buf) |
| 5723 | Lisp_Object buf; | ||
| 5724 | { | 5629 | { |
| 5725 | register struct buffer *buffer = XBUFFER (buf); | 5630 | register struct buffer *buffer = XBUFFER (buf); |
| 5726 | register Lisp_Object *ptr, tmp; | 5631 | register Lisp_Object *ptr, tmp; |
| @@ -5787,8 +5692,7 @@ mark_terminals (void) | |||
| 5787 | either marked or does not need to be marked to survive. */ | 5692 | either marked or does not need to be marked to survive. */ |
| 5788 | 5693 | ||
| 5789 | int | 5694 | int |
| 5790 | survives_gc_p (obj) | 5695 | survives_gc_p (Lisp_Object obj) |
| 5791 | Lisp_Object obj; | ||
| 5792 | { | 5696 | { |
| 5793 | int survives_p; | 5697 | int survives_p; |
| 5794 | 5698 | ||
| @@ -5834,7 +5738,7 @@ survives_gc_p (obj) | |||
| 5834 | /* Sweep: find all structures not marked, and free them. */ | 5738 | /* Sweep: find all structures not marked, and free them. */ |
| 5835 | 5739 | ||
| 5836 | static void | 5740 | static void |
| 5837 | gc_sweep () | 5741 | gc_sweep (void) |
| 5838 | { | 5742 | { |
| 5839 | /* Remove or mark entries in weak hash tables. | 5743 | /* Remove or mark entries in weak hash tables. |
| 5840 | This must be done before any object is unmarked. */ | 5744 | This must be done before any object is unmarked. */ |
| @@ -6251,10 +6155,7 @@ Frames, windows, buffers, and subprocesses count as vectors | |||
| 6251 | int suppress_checking; | 6155 | int suppress_checking; |
| 6252 | 6156 | ||
| 6253 | void | 6157 | void |
| 6254 | die (msg, file, line) | 6158 | die (const char *msg, const char *file, int line) |
| 6255 | const char *msg; | ||
| 6256 | const char *file; | ||
| 6257 | int line; | ||
| 6258 | { | 6159 | { |
| 6259 | fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", | 6160 | fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", |
| 6260 | file, line, msg); | 6161 | file, line, msg); |
| @@ -6264,7 +6165,7 @@ die (msg, file, line) | |||
| 6264 | /* Initialization */ | 6165 | /* Initialization */ |
| 6265 | 6166 | ||
| 6266 | void | 6167 | void |
| 6267 | init_alloc_once () | 6168 | init_alloc_once (void) |
| 6268 | { | 6169 | { |
| 6269 | /* Used to do Vpurify_flag = Qt here, but Qt isn't set up yet! */ | 6170 | /* Used to do Vpurify_flag = Qt here, but Qt isn't set up yet! */ |
| 6270 | purebeg = PUREBEG; | 6171 | purebeg = PUREBEG; |
| @@ -6319,7 +6220,7 @@ init_alloc_once () | |||
| 6319 | } | 6220 | } |
| 6320 | 6221 | ||
| 6321 | void | 6222 | void |
| 6322 | init_alloc () | 6223 | init_alloc (void) |
| 6323 | { | 6224 | { |
| 6324 | gcprolist = 0; | 6225 | gcprolist = 0; |
| 6325 | byte_stack_list = 0; | 6226 | byte_stack_list = 0; |
| @@ -6333,7 +6234,7 @@ init_alloc () | |||
| 6333 | } | 6234 | } |
| 6334 | 6235 | ||
| 6335 | void | 6236 | void |
| 6336 | syms_of_alloc () | 6237 | syms_of_alloc (void) |
| 6337 | { | 6238 | { |
| 6338 | DEFVAR_INT ("gc-cons-threshold", &gc_cons_threshold, | 6239 | DEFVAR_INT ("gc-cons-threshold", &gc_cons_threshold, |
| 6339 | doc: /* *Number of bytes of consing between garbage collections. | 6240 | doc: /* *Number of bytes of consing between garbage collections. |