Mercurial > emacs
comparison src/alloc.c @ 40107:d3cc7dd5d75a
Reindent DEFUNs with doc: keywords.
author | Pavel Janík <Pavel@Janik.cz> |
---|---|
date | Sun, 21 Oct 2001 08:48:26 +0000 |
parents | eac4e9ae201c |
children | 66132b83e52a |
comparison
equal
deleted
inserted
replaced
40106:28cb6f82af7f | 40107:d3cc7dd5d75a |
---|---|
1657 current_sblock = tb; | 1657 current_sblock = tb; |
1658 } | 1658 } |
1659 | 1659 |
1660 | 1660 |
1661 DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, | 1661 DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, |
1662 doc: /* Return a newly created string of length LENGTH, with each element being INIT. | 1662 doc: /* Return a newly created string of length LENGTH, with each element being INIT. |
1663 Both LENGTH and INIT must be numbers. */) | 1663 Both LENGTH and INIT must be numbers. */) |
1664 (length, init) | 1664 (length, init) |
1665 Lisp_Object length, init; | 1665 Lisp_Object length, init; |
1666 { | 1666 { |
1667 register Lisp_Object val; | 1667 register Lisp_Object val; |
1701 return val; | 1701 return val; |
1702 } | 1702 } |
1703 | 1703 |
1704 | 1704 |
1705 DEFUN ("make-bool-vector", Fmake_bool_vector, Smake_bool_vector, 2, 2, 0, | 1705 DEFUN ("make-bool-vector", Fmake_bool_vector, Smake_bool_vector, 2, 2, 0, |
1706 doc: /* Return a new bool-vector of length LENGTH, using INIT for as each element. | 1706 doc: /* Return a new bool-vector of length LENGTH, using INIT for as each element. |
1707 LENGTH must be a number. INIT matters only in whether it is t or nil. */) | 1707 LENGTH must be a number. INIT matters only in whether it is t or nil. */) |
1708 (length, init) | 1708 (length, init) |
1709 Lisp_Object length, init; | 1709 Lisp_Object length, init; |
1710 { | 1710 { |
1711 register Lisp_Object val; | 1711 register Lisp_Object val; |
2055 cons_free_list = ptr; | 2055 cons_free_list = ptr; |
2056 } | 2056 } |
2057 | 2057 |
2058 | 2058 |
2059 DEFUN ("cons", Fcons, Scons, 2, 2, 0, | 2059 DEFUN ("cons", Fcons, Scons, 2, 2, 0, |
2060 doc: /* Create a new cons, give it CAR and CDR as components, and return it. */) | 2060 doc: /* Create a new cons, give it CAR and CDR as components, and return it. */) |
2061 (car, cdr) | 2061 (car, cdr) |
2062 Lisp_Object car, cdr; | 2062 Lisp_Object car, cdr; |
2063 { | 2063 { |
2064 register Lisp_Object val; | 2064 register Lisp_Object val; |
2065 | 2065 |
2128 Fcons (arg5, Qnil))))); | 2128 Fcons (arg5, Qnil))))); |
2129 } | 2129 } |
2130 | 2130 |
2131 | 2131 |
2132 DEFUN ("list", Flist, Slist, 0, MANY, 0, | 2132 DEFUN ("list", Flist, Slist, 0, MANY, 0, |
2133 doc: /* Return a newly created list with specified arguments as elements. | 2133 doc: /* Return a newly created list with specified arguments as elements. |
2134 Any number of arguments, even zero arguments, are allowed. */) | 2134 Any number of arguments, even zero arguments, are allowed. */) |
2135 (nargs, args) | 2135 (nargs, args) |
2136 int nargs; | 2136 int nargs; |
2137 register Lisp_Object *args; | 2137 register Lisp_Object *args; |
2138 { | 2138 { |
2147 return val; | 2147 return val; |
2148 } | 2148 } |
2149 | 2149 |
2150 | 2150 |
2151 DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, | 2151 DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, |
2152 doc: /* Return a newly created list of length LENGTH, with each element being INIT. */) | 2152 doc: /* Return a newly created list of length LENGTH, with each element being INIT. */) |
2153 (length, init) | 2153 (length, init) |
2154 register Lisp_Object length, init; | 2154 register Lisp_Object length, init; |
2155 { | 2155 { |
2156 register Lisp_Object val; | 2156 register Lisp_Object val; |
2157 register int size; | 2157 register int size; |
2334 return v; | 2334 return v; |
2335 } | 2335 } |
2336 | 2336 |
2337 | 2337 |
2338 DEFUN ("make-vector", Fmake_vector, Smake_vector, 2, 2, 0, | 2338 DEFUN ("make-vector", Fmake_vector, Smake_vector, 2, 2, 0, |
2339 doc: /* Return a newly created vector of length LENGTH, with each element being INIT. | 2339 doc: /* Return a newly created vector of length LENGTH, with each element being INIT. |
2340 See also the function `vector'. */) | 2340 See also the function `vector'. */) |
2341 (length, init) | 2341 (length, init) |
2342 register Lisp_Object length, init; | 2342 register Lisp_Object length, init; |
2343 { | 2343 { |
2344 Lisp_Object vector; | 2344 Lisp_Object vector; |
2357 return vector; | 2357 return vector; |
2358 } | 2358 } |
2359 | 2359 |
2360 | 2360 |
2361 DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0, | 2361 DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0, |
2362 doc: /* Return a newly created char-table, with purpose PURPOSE. | 2362 doc: /* Return a newly created char-table, with purpose PURPOSE. |
2363 Each element is initialized to INIT, which defaults to nil. | 2363 Each element is initialized to INIT, which defaults to nil. |
2364 PURPOSE should be a symbol which has a `char-table-extra-slots' property. | 2364 PURPOSE should be a symbol which has a `char-table-extra-slots' property. |
2365 The property's value should be an integer between 0 and 10. */) | 2365 The property's value should be an integer between 0 and 10. */) |
2366 (purpose, init) | 2366 (purpose, init) |
2367 register Lisp_Object purpose, init; | 2367 register Lisp_Object purpose, init; |
2400 return vector; | 2400 return vector; |
2401 } | 2401 } |
2402 | 2402 |
2403 | 2403 |
2404 DEFUN ("vector", Fvector, Svector, 0, MANY, 0, | 2404 DEFUN ("vector", Fvector, Svector, 0, MANY, 0, |
2405 doc: /* Return a newly created vector with specified arguments as elements. | 2405 doc: /* Return a newly created vector with specified arguments as elements. |
2406 Any number of arguments, even zero arguments, are allowed. */) | 2406 Any number of arguments, even zero arguments, are allowed. */) |
2407 (nargs, args) | 2407 (nargs, args) |
2408 register int nargs; | 2408 register int nargs; |
2409 Lisp_Object *args; | 2409 Lisp_Object *args; |
2410 { | 2410 { |
2420 return val; | 2420 return val; |
2421 } | 2421 } |
2422 | 2422 |
2423 | 2423 |
2424 DEFUN ("make-byte-code", Fmake_byte_code, Smake_byte_code, 4, MANY, 0, | 2424 DEFUN ("make-byte-code", Fmake_byte_code, Smake_byte_code, 4, MANY, 0, |
2425 doc: /* Create a byte-code object with specified arguments as elements. | 2425 doc: /* Create a byte-code object with specified arguments as elements. |
2426 The arguments should be the arglist, bytecode-string, constant vector, | 2426 The arguments should be the arglist, bytecode-string, constant vector, |
2427 stack size, (optional) doc string, and (optional) interactive spec. | 2427 stack size, (optional) doc string, and (optional) interactive spec. |
2428 The first four arguments are required; at most six have any | 2428 The first four arguments are required; at most six have any |
2429 significance. */) | 2429 significance. */) |
2430 (nargs, args) | 2430 (nargs, args) |
2508 n_symbol_blocks = 1; | 2508 n_symbol_blocks = 1; |
2509 } | 2509 } |
2510 | 2510 |
2511 | 2511 |
2512 DEFUN ("make-symbol", Fmake_symbol, Smake_symbol, 1, 1, 0, | 2512 DEFUN ("make-symbol", Fmake_symbol, Smake_symbol, 1, 1, 0, |
2513 doc: /* Return a newly allocated uninterned symbol whose name is NAME. | 2513 doc: /* Return a newly allocated uninterned symbol whose name is NAME. |
2514 Its value and function definition are void, and its property list is nil. */) | 2514 Its value and function definition are void, and its property list is nil. */) |
2515 (name) | 2515 (name) |
2516 Lisp_Object name; | 2516 Lisp_Object name; |
2517 { | 2517 { |
2518 register Lisp_Object val; | 2518 register Lisp_Object val; |
2626 misc_objects_consed++; | 2626 misc_objects_consed++; |
2627 return val; | 2627 return val; |
2628 } | 2628 } |
2629 | 2629 |
2630 DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, | 2630 DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, |
2631 doc: /* Return a newly allocated marker which does not point at any place. */) | 2631 doc: /* Return a newly allocated marker which does not point at any place. */) |
2632 () | 2632 () |
2633 { | 2633 { |
2634 register Lisp_Object val; | 2634 register Lisp_Object val; |
2635 register struct Lisp_Marker *p; | 2635 register struct Lisp_Marker *p; |
2636 | 2636 |
5318 | 5318 |
5319 | 5319 |
5320 /* Debugging aids. */ | 5320 /* Debugging aids. */ |
5321 | 5321 |
5322 DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0, | 5322 DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0, |
5323 doc: /* Return the address of the last byte Emacs has allocated, divided by 1024. | 5323 doc: /* Return the address of the last byte Emacs has allocated, divided by 1024. |
5324 This may be helpful in debugging Emacs's memory usage. | 5324 This may be helpful in debugging Emacs's memory usage. |
5325 We divide the value by 1024 to make sure it fits in a Lisp integer. */) | 5325 We divide the value by 1024 to make sure it fits in a Lisp integer. */) |
5326 () | 5326 () |
5327 { | 5327 { |
5328 Lisp_Object end; | 5328 Lisp_Object end; |
5331 | 5331 |
5332 return end; | 5332 return end; |
5333 } | 5333 } |
5334 | 5334 |
5335 DEFUN ("memory-use-counts", Fmemory_use_counts, Smemory_use_counts, 0, 0, 0, | 5335 DEFUN ("memory-use-counts", Fmemory_use_counts, Smemory_use_counts, 0, 0, 0, |
5336 doc: /* Return a list of counters that measure how much consing there has been. | 5336 doc: /* Return a list of counters that measure how much consing there has been. |
5337 Each of these counters increments for a certain kind of object. | 5337 Each of these counters increments for a certain kind of object. |
5338 The counters wrap around from the largest positive integer to zero. | 5338 The counters wrap around from the largest positive integer to zero. |
5339 Garbage collection does not decrease them. | 5339 Garbage collection does not decrease them. |
5340 The elements of the value are as follows: | 5340 The elements of the value are as follows: |
5341 (CONSES FLOATS VECTOR-CELLS SYMBOLS STRING-CHARS MISCS INTERVALS STRINGS) | 5341 (CONSES FLOATS VECTOR-CELLS SYMBOLS STRING-CHARS MISCS INTERVALS STRINGS) |
5437 | 5437 |
5438 void | 5438 void |
5439 syms_of_alloc () | 5439 syms_of_alloc () |
5440 { | 5440 { |
5441 DEFVAR_INT ("gc-cons-threshold", &gc_cons_threshold, | 5441 DEFVAR_INT ("gc-cons-threshold", &gc_cons_threshold, |
5442 doc: /* *Number of bytes of consing between garbage collections. | 5442 doc: /* *Number of bytes of consing between garbage collections. |
5443 Garbage collection can happen automatically once this many bytes have been | 5443 Garbage collection can happen automatically once this many bytes have been |
5444 allocated since the last garbage collection. All data types count. | 5444 allocated since the last garbage collection. All data types count. |
5445 | 5445 |
5446 Garbage collection happens automatically only when `eval' is called. | 5446 Garbage collection happens automatically only when `eval' is called. |
5447 | 5447 |
5448 By binding this temporarily to a large number, you can effectively | 5448 By binding this temporarily to a large number, you can effectively |
5449 prevent garbage collection during a part of the program. */); | 5449 prevent garbage collection during a part of the program. */); |
5450 | 5450 |
5451 DEFVAR_INT ("pure-bytes-used", &pure_bytes_used, | 5451 DEFVAR_INT ("pure-bytes-used", &pure_bytes_used, |
5452 doc: /* Number of bytes of sharable Lisp data allocated so far. */); | 5452 doc: /* Number of bytes of sharable Lisp data allocated so far. */); |
5453 | 5453 |
5454 DEFVAR_INT ("cons-cells-consed", &cons_cells_consed, | 5454 DEFVAR_INT ("cons-cells-consed", &cons_cells_consed, |
5455 doc: /* Number of cons cells that have been consed so far. */); | 5455 doc: /* Number of cons cells that have been consed so far. */); |
5456 | 5456 |
5457 DEFVAR_INT ("floats-consed", &floats_consed, | 5457 DEFVAR_INT ("floats-consed", &floats_consed, |
5458 doc: /* Number of floats that have been consed so far. */); | 5458 doc: /* Number of floats that have been consed so far. */); |
5459 | 5459 |
5460 DEFVAR_INT ("vector-cells-consed", &vector_cells_consed, | 5460 DEFVAR_INT ("vector-cells-consed", &vector_cells_consed, |
5461 doc: /* Number of vector cells that have been consed so far. */); | 5461 doc: /* Number of vector cells that have been consed so far. */); |
5462 | 5462 |
5463 DEFVAR_INT ("symbols-consed", &symbols_consed, | 5463 DEFVAR_INT ("symbols-consed", &symbols_consed, |
5464 doc: /* Number of symbols that have been consed so far. */); | 5464 doc: /* Number of symbols that have been consed so far. */); |
5465 | 5465 |
5466 DEFVAR_INT ("string-chars-consed", &string_chars_consed, | 5466 DEFVAR_INT ("string-chars-consed", &string_chars_consed, |
5467 doc: /* Number of string characters that have been consed so far. */); | 5467 doc: /* Number of string characters that have been consed so far. */); |
5468 | 5468 |
5469 DEFVAR_INT ("misc-objects-consed", &misc_objects_consed, | 5469 DEFVAR_INT ("misc-objects-consed", &misc_objects_consed, |
5470 doc: /* Number of miscellaneous objects that have been consed so far. */); | 5470 doc: /* Number of miscellaneous objects that have been consed so far. */); |
5471 | 5471 |
5472 DEFVAR_INT ("intervals-consed", &intervals_consed, | 5472 DEFVAR_INT ("intervals-consed", &intervals_consed, |
5473 doc: /* Number of intervals that have been consed so far. */); | 5473 doc: /* Number of intervals that have been consed so far. */); |
5474 | 5474 |
5475 DEFVAR_INT ("strings-consed", &strings_consed, | 5475 DEFVAR_INT ("strings-consed", &strings_consed, |
5476 doc: /* Number of strings that have been consed so far. */); | 5476 doc: /* Number of strings that have been consed so far. */); |
5477 | 5477 |
5478 DEFVAR_LISP ("purify-flag", &Vpurify_flag, | 5478 DEFVAR_LISP ("purify-flag", &Vpurify_flag, |
5479 doc: /* Non-nil means loading Lisp code in order to dump an executable. | 5479 doc: /* Non-nil means loading Lisp code in order to dump an executable. |
5480 This means that certain objects should be allocated in shared (pure) space. */); | 5480 This means that certain objects should be allocated in shared (pure) space. */); |
5481 | 5481 |
5482 DEFVAR_INT ("undo-limit", &undo_limit, | 5482 DEFVAR_INT ("undo-limit", &undo_limit, |
5483 doc: /* Keep no more undo information once it exceeds this size. | 5483 doc: /* Keep no more undo information once it exceeds this size. |
5484 This limit is applied when garbage collection happens. | 5484 This limit is applied when garbage collection happens. |
5485 The size is counted as the number of bytes occupied, | 5485 The size is counted as the number of bytes occupied, |
5486 which includes both saved text and other data. */); | 5486 which includes both saved text and other data. */); |
5487 undo_limit = 20000; | 5487 undo_limit = 20000; |
5488 | 5488 |
5489 DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, | 5489 DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, |
5490 doc: /* Don't keep more than this much size of undo information. | 5490 doc: /* Don't keep more than this much size of undo information. |
5491 A command which pushes past this size is itself forgotten. | 5491 A command which pushes past this size is itself forgotten. |
5492 This limit is applied when garbage collection happens. | 5492 This limit is applied when garbage collection happens. |
5493 The size is counted as the number of bytes occupied, | 5493 The size is counted as the number of bytes occupied, |
5494 which includes both saved text and other data. */); | 5494 which includes both saved text and other data. */); |
5495 undo_strong_limit = 30000; | 5495 undo_strong_limit = 30000; |
5496 | 5496 |
5497 DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, | 5497 DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, |
5498 doc: /* Non-nil means display messages at start and end of garbage collection. */); | 5498 doc: /* Non-nil means display messages at start and end of garbage collection. */); |
5499 garbage_collection_messages = 0; | 5499 garbage_collection_messages = 0; |
5500 | 5500 |
5501 DEFVAR_LISP ("post-gc-hook", &Vpost_gc_hook, | 5501 DEFVAR_LISP ("post-gc-hook", &Vpost_gc_hook, |
5502 doc: /* Hook run after garbage collection has finished. */); | 5502 doc: /* Hook run after garbage collection has finished. */); |
5503 Vpost_gc_hook = Qnil; | 5503 Vpost_gc_hook = Qnil; |
5504 Qpost_gc_hook = intern ("post-gc-hook"); | 5504 Qpost_gc_hook = intern ("post-gc-hook"); |
5505 staticpro (&Qpost_gc_hook); | 5505 staticpro (&Qpost_gc_hook); |
5506 | 5506 |
5507 /* We build this in advance because if we wait until we need it, we might | 5507 /* We build this in advance because if we wait until we need it, we might |