Mercurial > emacs
comparison src/alloc.c @ 65832:5159ee08b219
(refill_memory_reserve): Conditionalize the body, not the function's existence.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Tue, 04 Oct 2005 20:26:13 +0000 |
| parents | 375ab086d366 |
| children | 0e243de6311b 2a679c81f552 aa89c814f853 |
comparison
equal
deleted
inserted
replaced
| 65831:778ea3690703 | 65832:5159ee08b219 |
|---|---|
| 545 () | 545 () |
| 546 { | 546 { |
| 547 return (spare_memory ? Qnil : Qt); | 547 return (spare_memory ? Qnil : Qt); |
| 548 } | 548 } |
| 549 | 549 |
| 550 /* If we released our reserve (due to running out of memory), | |
| 551 and we have a fair amount free once again, | |
| 552 try to set aside another reserve in case we run out once more. | |
| 553 | |
| 554 This is called when a relocatable block is freed in ralloc.c. */ | |
| 555 | |
| 556 void | |
| 557 refill_memory_reserve () | |
| 558 { | |
| 559 #ifndef SYSTEM_MALLOC | |
| 560 if (spare_memory == 0) | |
| 561 spare_memory = (char *) malloc ((size_t) SPARE_MEMORY); | |
| 562 #endif | |
| 563 } | |
| 564 | |
| 550 /* Called if we can't allocate relocatable space for a buffer. */ | 565 /* Called if we can't allocate relocatable space for a buffer. */ |
| 551 | 566 |
| 552 void | 567 void |
| 553 buffer_memory_full () | 568 buffer_memory_full () |
| 554 { | 569 { |
| 1132 } | 1147 } |
| 1133 | 1148 |
| 1134 | 1149 |
| 1135 #ifndef SYSTEM_MALLOC | 1150 #ifndef SYSTEM_MALLOC |
| 1136 | 1151 |
| 1137 /* If we released our reserve (due to running out of memory), | |
| 1138 and we have a fair amount free once again, | |
| 1139 try to set aside another reserve in case we run out once more. | |
| 1140 | |
| 1141 This is called when a relocatable block is freed in ralloc.c. */ | |
| 1142 | |
| 1143 void | |
| 1144 refill_memory_reserve () | |
| 1145 { | |
| 1146 if (spare_memory == 0) | |
| 1147 spare_memory = (char *) malloc ((size_t) SPARE_MEMORY); | |
| 1148 } | |
| 1149 | |
| 1150 | |
| 1151 /* Arranging to disable input signals while we're in malloc. | 1152 /* Arranging to disable input signals while we're in malloc. |
| 1152 | 1153 |
| 1153 This only works with GNU malloc. To help out systems which can't | 1154 This only works with GNU malloc. To help out systems which can't |
| 1154 use GNU malloc, all the calls to malloc, realloc, and free | 1155 use GNU malloc, all the calls to malloc, realloc, and free |
| 1155 elsewhere in the code should be inside a BLOCK_INPUT/UNBLOCK_INPUT | 1156 elsewhere in the code should be inside a BLOCK_INPUT/UNBLOCK_INPUT |
