1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 08:11:05 -08:00
Commit graph

383 commits

Author SHA1 Message Date
Andreas Schwab
28a099a4aa (free_float): Make free list chaining aliasing-safe.
(make_float): Likewise.
(free_cons): Likewise.
(Fcons): Likewise.
(check_cons_list): Likewise.
(Fmake_symbol): Likewise.
(allocate_misc): Likewise.
(free_misc): Likewise.
(gc_sweep): Likewise.
2005-11-15 13:53:45 +00:00
Kim F. Storm
3cd5573537 (valid_lisp_object_p): New function to validate that
an object is really a valid Lisp_Object.
2005-11-09 23:14:12 +00:00
Richard M. Stallman
225ccad65e (refill_memory_reserve): Move decl out of conditionals. 2005-11-03 21:11:20 +00:00
Richard M. Stallman
4d74a5fc8e (BYTES_USED): Use uordblks, not arena.
(bytes_used_when_reconsidered): New variable.
(emacs_blocked_free): Set that.
2005-10-30 07:36:35 +00:00
Chong Yidong
bccfb31031 * alloc.c (emacs_blocked_free): Fix typo. 2005-10-29 20:17:48 +00:00
Richard M. Stallman
24d8a105d8 (syms_of_alloc) <memory-full>: Doc fix.
(Fmemory_full_p): Function deleted.
(syms_of_alloc): Don't defsubr it.
(memory_full_cons_threshold): New variable.
(spare_memory): Now a vector of 7 elts.
(buffer_memory_full): Don't set Vmemory_full here.
(xfree): Don't try to refill here.
(emacs_blocked_free): Record BYTES_USED in local var.
(memory_full): Now free all the slots in spare_memory.
(refill_memory_reserve): Allocate each slot in spare_memory.
(init_alloc_once): Call refill_memory_reserve.
2005-10-29 19:39:50 +00:00
Richard M. Stallman
745575ff14 (spare_memory): No longer static.
(xfree) [!SYSTEM_MALLOC]: Call refill_memory_reserve.
2005-10-28 16:25:37 +00:00
Richard M. Stallman
49efed3a0f (refill_memory_reserve): Conditionalize the body, not the function's existence. 2005-10-04 20:26:13 +00:00
Dan Nicolaescu
fa8459a34e * image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct
type.
* xterm.c (handle_one_xevent, handle_one_xevent): Likewise.

* unexelf.c (fatal): Fix prototype.

* term.c (fatal): Implement using varargs.

* regex.c (re_char): Move typedef ...
* regex.h (re_char): ... here.
(re_iswctype, re_wctype, re_set_whitespace_regexp): New
prototypes.

* emacs.c (malloc_set_state): Fix return type.
(endif): Fix type.

* lisp.h (fatal): Add argument types.

* dispextern.h (fatal): Delete prototype.

* systime.h: (make_time): Prototype moved from ...
* editfns.c (make_time): ... here.

* editfns.c: Move systime.h include after lisp.h.
* dired.c:
* xsmfns.c:
* process.c: Likewise.

* alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook):
Add parameter types.
(__malloc_hook, __realloc_hook, __free_hook): Fix prototypes.
(emacs_blocked_free): Change definition to match __free_hook.
(emacs_blocked_malloc): Change definition to match __malloc_hook.
(emacs_blocked_realloc): Change definition to match
__realloc_hook.
2005-09-30 22:38:16 +00:00
Richard M. Stallman
974aae61bb (gc_cons_threshold): Not static.
(gc_cons_combined_threshold): Var deleted.
(gc_relative_threshold): New variable.
(Fgarbage_collect, init_alloc_once): Compute gc_relative_threshold
instead of gc_cons_combined_threshold.
2005-07-23 19:08:06 +00:00
Stefan Monnier
aa37e9e246 (gc_cons_threshold): Make it static. 2005-07-13 05:33:34 +00:00
Stefan Monnier
96f077ad71 (gc_cons_combined_threshold, Vgc_cons_percentage): New vars.
(Fgarbage_collect, init_alloc_once): Set gc_cons_combined_threshold.
(syms_of_alloc): Declare gc-cons-percentage.
2005-07-13 05:28:37 +00:00
Lute Kamstra
4fc5845fe8 Update FSF's address. 2005-07-04 16:49:24 +00:00
Juanma Barranquero
8349069cda Fix typo in comment. 2005-05-24 15:34:09 +00:00
Richard M. Stallman
8a4c9dc44e (Fmemory_full_p): New function.
(syms_of_alloc): defsubr it.
2005-05-14 14:07:03 +00:00
Kenichi Handa
2a7a8e99f2 (make_sub_char_table): Argument changed to initial
value of the slots.
2005-04-20 07:50:08 +00:00
Kim F. Storm
bbc012e0c3 (Fgarbage_collect): Call CHECK_CONS_LIST before and after gc. 2005-04-03 22:27:05 +00:00
Jan Djärv
1673df2e0d * alloc.c (allocate_string_data): Call BLOCK_INPUT before calling
mallopt.

* ralloc.c (r_alloc_init): Ditto.
2005-04-02 12:05:38 +00:00
Stefan Monnier
217604dab1 (make_number): The arg can be bigger than `int'. 2005-03-24 19:51:13 +00:00
Stefan Monnier
f501ccb45f (BLOCK_BYTES): Harmless typo. 2005-02-18 18:16:09 +00:00
Kim F. Storm
b059de99a9 (STRING_MARKED_P, VECTOR_MARKED_P): Return boolean. 2005-01-20 15:37:41 +00:00
Kim F. Storm
454d797353 (mark_fringe_data): Declare extern.
(Fgarbage_collect): Call mark_fringe_data.

(overrun_check_free): Invalidate freed memory if
XMALLOC_CLEAR_FREE_MEMORY is defined.
2005-01-06 22:02:32 +00:00
Stefan Monnier
026cdede85 (refill_memory_reserve): Move.
(emacs_blocked_free, emacs_blocked_malloc, emacs_blocked_realloc)
(reset_malloc_hooks, uninterrupt_malloc) [SYNC_INPUT]: Don't define.
2005-01-04 20:22:41 +00:00
Richard M. Stallman
303b041210 (Fgarbage_collect): Don't truncate_undo_list on dead buffers. 2005-01-02 22:52:23 +00:00
Jan Djärv
d8f165a83e Update comment for check_depth. 2004-12-25 10:31:36 +00:00
Jan Djärv
857ae68b96 * alloc.c (check_depth): New variable.
(overrun_check_malloc, overrun_check_realloc): Only add
overhead and write check pattern if check_depth is 1 (to handle
recursive calls).  Increase/decrease check_depth in entry/exit.
(overrun_check_free): Only check for overhead if check_depth is 1.
Increase/decrease check_depth in entry/exit.
2004-12-25 10:13:57 +00:00
Richard M. Stallman
3c7e66a8a7 (Fgarbage_collect): Update call to truncate_undo_list.
Call that at the very start.
(undo_limit, undo_strong_limit, undo_outer_limit): To undo.c.
(syms_of_alloc): Don't define undo-limit,
undo-strong-limit and undo-outer-limit here.
2004-12-21 11:30:31 +00:00
Jan Djärv
333f1b6f78 * syssignal.h: Declare main_thread.
(SIGNAL_THREAD_CHECK): New macro.

* keyboard.c (input_available_signal): Move thread checking code
to macro SIGNAL_THREAD_CHECK and call that macro.
(interrupt_signal): Call SIGNAL_THREAD_CHECK.

* alloc.c (uninterrupt_malloc): Move main_thread to emacs.c.

* emacs.c: Define main_thread.
(main): Initialize main_thread.
(handle_USR1_signal, handle_USR2_signal, fatal_error_signal)
(memory_warning_signal): Call SIGNAL_THREAD_CHECK.

* floatfns.c (float_error): Call SIGNAL_THREAD_CHECK.

* dispnew.c (window_change_signal): Call SIGNAL_THREAD_CHECK.

* sysdep.c (select_alarm): Call SIGNAL_THREAD_CHECK.

* process.c (send_process_trap, sigchld_handler): Call
SIGNAL_THREAD_CHECK.

* data.c (arith_error): Call SIGNAL_THREAD_CHECK.

* atimer.c (alarm_signal_handler): Call SIGNAL_THREAD_CHECK.
2004-12-15 21:40:41 +00:00
Jan Djärv
f415cacdbd * alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC. 2004-12-07 17:38:30 +00:00
Jan Djärv
aa477689e5 * gtkutil.c: Include signal.h and syssignal.h.
(xg_get_file_name): Block and unblock __SIGRTMIN if defined.

* alloc.c: If HAVE_GTK_AND_PTHREAD, include pthread.h,
new variables main_thread and alloc_mutex,
define (UN)BLOCK_INPUT_ALLOC to use alloc_mutex to protect
emacs_blocked_* calls and only do (UN)BLOCK_INPUT in the main thread.
If not HAVE_GTK_AND_PTHREAD, (UN)BLOCK_INPUT_ALLOC is the same as
(UN)BLOCK_INPUT.
(emacs_blocked_free, emacs_blocked_malloc)
(emacs_blocked_realloc): Use (UN)BLOCK_INPUT_ALLOC.
(uninterrupt_malloc): Initialize main_thread and alloc_mutex.
(reset_malloc_hooks): New function.

* lisp.h: Declare reset_malloc_hooks.

* emacs.c (Fdump_emacs): Call reset_malloc_hooks.

* keyboard.c: Conditionally include pthread.h
(handle_async_inpu, input_available_signalt): If not in the main
thread, block signal, send signal to main thread and return.
2004-12-07 08:25:43 +00:00
Kim F. Storm
bdbed94997 Add commentary for last change.
(XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): New macros to handle
sizeof(size_t) != 4.
(overrun_check_malloc, overrun_check_realloc, overrun_check_free):
Use them.  Also clear header and trailer of freed memory.
(GC_STRING_OVERRUN_COOKIE_SIZE): Rename from GC_STRING_EXTRA.
(string_overrun_cookie): Rename from string_overrun_pattern.
(GC_STRING_EXTRA): Define from GC_STRING_OVERRUN_COOKIE_SIZE.
2004-12-01 14:10:23 +00:00
Kim F. Storm
212f33f185 Add more checks for buffer overruns.
(XMALLOC_OVERRUN_CHECK_SIZE, xmalloc_overrun_check_header)
xmalloc_overrun_check_trailer, overrun_check_malloc)
overrun_check_realloc, overrun_check_free): Add.
(GC_STRING_EXTRA, string_overrun_pattern): Add.
(check_sblock, allocate_string_data, compact_small_strings):
Set and check string_overrun_pattern if GC_CHECK_STRING_OVERRUN.
(check_cons_list): Condition on GC_CHECK_CONS_LIST.
(check_string_free_list): Add.
(allocate_string, sweep_strings): Call check_string_free_list.
2004-11-30 00:30:56 +00:00
Andreas Schwab
4dec23ff0b (mark_stack): Call GC_MARK_SECONDARY_STACK if defined. 2004-11-27 22:40:50 +00:00
Richard M. Stallman
1b8950e531 Comment change. 2004-09-18 19:18:58 +00:00
Stefan Monnier
126f9c02d4 (Fgarbage_collect): Mark keyboards, gtk data, and specpdl
before doing the mark_stack_check_gcpros since they are not on the stack.
2004-09-13 21:06:31 +00:00
Richard M. Stallman
e3e56238b8 (check_cons_list): New function (contents commented out). 2004-07-25 17:35:04 +00:00
Kim F. Storm
9ea306d178 (mark_object): Only look at Lisp_Misc_Save_Value if GC_MARK_STACK. 2004-07-12 14:35:53 +00:00
Kim F. Storm
7b7990cc67 (allocate_misc): Update total_free_markers.
(free_misc): New function.
(safe_alloca_unwind, free_marker): Use it.
2004-06-24 22:02:23 +00:00
Kim F. Storm
b766f87064 (safe_alloca_unwind): Clear dogc and pointer members.
(make_save_value): Init new dogc member.
(mark_object): Mark Lisp_Save_Value pointer array if dogc is set.
2004-06-22 13:56:34 +00:00
Kim F. Storm
f61bef8be5 (safe_alloca_unwind): New function. 2004-06-21 21:51:50 +00:00
Richard M. Stallman
ae6a9bfec9 (undo_outer_limit): New variable.
(syms_of_alloc): Defvar it.
(Fgarbage_collect): Pass undo_outer_limit to truncate_undo_list.
2004-05-29 16:19:41 +00:00
Richard M. Stallman
ab349c191f (lisp_align_malloc): Check for base == 0 regardless of HAVE_POSIX_MEMALIGN.
Clean up HAVE_POSIX_MEMALIGN handling of `err'.
2004-05-29 16:10:27 +00:00
Stefan Monnier
c37adf23e8 Undo Kim's recent changes and fix the same bug differently.
(marker_blocks_pending_free): Remove.
(Fgarbage_collect): Sweep after cleaning up undo-lists.
Mark the undo lists after claning them up.
Don't free block in marker_blocks_pending_free.
(mark_buffer): Don't mark undo_list.
(gc_sweep): Sweep hash-tables and strings first.
Do free marker blocks that are empty.
2004-05-29 00:00:17 +00:00
Stefan Monnier
b40ea20a66 (struct backtrace): Remove.
(Fgarbage_collect): Use the new mark_backtrace.
2004-05-28 20:59:14 +00:00
Kim F. Storm
6b67a5180d (marker_blocks_pending_free): New var.
(gc_sweep): Store free marker blocks on that list.
(Fgarbage_collect): Free them after undo-list cleanup.
2004-05-25 11:18:07 +00:00
Richard M. Stallman
69623621a4 (Fmake_string): Doc fix. 2004-05-22 22:22:38 +00:00
Kim F. Storm
0dbaecd24a (struct backtrace): Add debug_on_exit member.
(Fgarbage_collect): Clear out buffer undo_list markers after gc_sweep.
Identify those markers as Lisp_Misc_Free objects.  Clear car and cdr of
the removed cons cells.
(mark_object): Undo previous change - disallow Lisp_Misc_Free objects.
(gc_sweep): Clear cons_blocks before sweeping strings, so we don't have
any cons cells pointing to unallocated stings.
Do not lisp_free any marker blocks, as there may still be pointers
to them from buffer undo lists at this stage of GC.
2004-05-21 23:36:10 +00:00
Stefan Monnier
74c35a48a7 (Fgarbage_collect): Do all the marking before flushing
unmarked elements of the undo list.
2004-05-18 16:22:46 +00:00
Kim F. Storm
d080618c7e (mark_object): Mark Lisp_Misc_Free cell. Fix comment. 2004-05-17 15:20:16 +00:00
Kim F. Storm
d2db1c32fa (mark_object): Ignore Lisp_Misc_Free objects.
Such objects may be freed markers which still exist on an undo list.
2004-05-17 12:08:02 +00:00