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
Andreas Schwab
a097329fe7
(Fmake_bool_vector): Use BOOL_VECTOR_BITS_PER_CHAR instead of
...
BITS_PER_CHAR for bool vectors.
2004-04-26 21:42:49 +00:00
Andreas Schwab
41b867eace
(Fpurecopy): Declare size as EMACS_INT to not lose bits.
2004-01-26 11:54:36 +00:00
Stefan Monnier
831b476c5a
(lisp_malloc, lisp_align_malloc) [USE_LSB_TAG]:
...
Don't check range of malloc address.
(pure_alloc) [USE_LSB_TAG]: Enforce alignment.
2004-01-21 03:34:32 +00:00
Stefan Monnier
d05b383acd
(struct interval_block, struct string_block)
...
(struct symbol_block, struct marker_block, live_string_p)
(live_cons_p, live_symbol_p, live_float_p, live_misc_p):
Better preserve alignment for objects in blocks.
(FLOAT_BLOCK_SIZE): Adjust for possible alignment padding.
2004-01-14 14:35:23 +00:00
Jan Djärv
de7515d6b8
* alloc.c (allocate_vectorlike): Surround calls to mallopt with
...
BLOCK/UNBLOCK_INPUT.
2004-01-11 21:50:12 +00:00
Stefan Monnier
a06681266b
(make_float, Fcons): Clear the markbit at init time.
...
(make_float, Fcons, Fmake_symbol, allocate_misc): Move the increment
of block_index outside of the macro call.
(Fgarbage_collect): Remove null code.
2003-11-18 00:39:13 +00:00
Richard M. Stallman
4532fdde32
(lisp_align_malloc): If BASE is 0, call memory_full.
2003-10-13 18:45:03 +00:00
Dave Love
ad5f3636c5
(GC_MALLOC_CHECK): Move conditional undef after lisp.h.
2003-09-19 15:50:56 +00:00
Stefan Monnier
1aad248540
(init_marker): Remove debugging code.
2003-09-11 22:41:16 +00:00
Stefan Monnier
0930c1a1c8
(init_intervals, init_symbol, init_marker): Don't preallocate anything.
...
(Fgarbage_collect, mark_object): Ignore the markbit.
2003-09-11 22:22:11 +00:00
Andreas Schwab
03bb6a06e1
Use long instead of int when casting ABLOCKS_BUSY to
...
avoid warning.
2003-09-07 19:15:51 +00:00
Miles Bader
ab5796a9f9
Add arch taglines
2003-09-01 15:45:59 +00:00
Dave Love
d748931263
(lisp_align_malloc): Change type of `aligned'.
2003-08-20 16:46:33 +00:00
Gerd Moellmann
f4446bbf6f
(lisp_align_malloc): Check for memory full when
...
allocating ablocks, which also avoids freeing a pointer into an
ablocks structure.
2003-08-19 12:58:35 +00:00