aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* (Fmemory_full_p): New function.Richard M. Stallman2005-05-141-0/+7
| | | | (syms_of_alloc): defsubr it.
* (make_sub_char_table): Argument changed to initialKenichi Handa2005-04-201-5/+5
| | | | value of the slots.
* (Fgarbage_collect): Call CHECK_CONS_LIST before and after gc.Kim F. Storm2005-04-031-0/+4
|
* * alloc.c (allocate_string_data): Call BLOCK_INPUT before callingJan Djärv2005-04-021-0/+4
| | | | | | mallopt. * ralloc.c (r_alloc_init): Ditto.
* (make_number): The arg can be bigger than `int'.Stefan Monnier2005-03-241-1/+1
|
* (BLOCK_BYTES): Harmless typo.Stefan Monnier2005-02-181-5/+6
|
* (STRING_MARKED_P, VECTOR_MARKED_P): Return boolean.Kim F. Storm2005-01-201-2/+2
|
* (mark_fringe_data): Declare extern.Kim F. Storm2005-01-061-0/+10
| | | | | | | (Fgarbage_collect): Call mark_fringe_data. (overrun_check_free): Invalidate freed memory if XMALLOC_CLEAR_FREE_MEMORY is defined.
* (refill_memory_reserve): Move.Stefan Monnier2005-01-041-17/+21
| | | | | (emacs_blocked_free, emacs_blocked_malloc, emacs_blocked_realloc) (reset_malloc_hooks, uninterrupt_malloc) [SYNC_INPUT]: Don't define.
* (Fgarbage_collect): Don't truncate_undo_list on dead buffers.Richard M. Stallman2005-01-021-1/+1
|
* Update comment for check_depth.Jan Djärv2004-12-251-12/+14
|
* * alloc.c (check_depth): New variable.Jan Djärv2004-12-251-4/+31
| | | | | | | | (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.
* (Fgarbage_collect): Update call to truncate_undo_list.Richard M. Stallman2004-12-211-67/+37
| | | | | | | 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.
* * syssignal.h: Declare main_thread.Jan Djärv2004-12-151-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* * alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC.Jan Djärv2004-12-071-0/+17
|
* * gtkutil.c: Include signal.h and syssignal.h.Jan Djärv2004-12-071-6/+67
| | | | | | | | | | | | | | | | | | | | | | | (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.
* Add commentary for last change.Kim F. Storm2004-12-011-23/+77
| | | | | | | | | | (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.
* Add more checks for buffer overruns.Kim F. Storm2004-11-301-9/+152
| | | | | | | | | | | | (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.
* (mark_stack): Call GC_MARK_SECONDARY_STACK if defined.Andreas Schwab2004-11-271-0/+5
|
* Comment change.Richard M. Stallman2004-09-181-2/+5
|
* (Fgarbage_collect): Mark keyboards, gtk data, and specpdlStefan Monnier2004-09-131-15/+16
| | | | before doing the mark_stack_check_gcpros since they are not on the stack.
* (check_cons_list): New function (contents commented out).Richard M. Stallman2004-07-251-0/+11
|
* (mark_object): Only look at Lisp_Misc_Save_Value if GC_MARK_STACK.Kim F. Storm2004-07-121-0/+2
|
* (allocate_misc): Update total_free_markers.Kim F. Storm2004-06-241-6/+17
| | | | | (free_misc): New function. (safe_alloca_unwind, free_marker): Use it.
* (safe_alloca_unwind): Clear dogc and pointer members.Kim F. Storm2004-06-221-1/+23
| | | | | (make_save_value): Init new dogc member. (mark_object): Mark Lisp_Save_Value pointer array if dogc is set.
* (safe_alloca_unwind): New function.Kim F. Storm2004-06-211-0/+11
|
* (undo_outer_limit): New variable.Richard M. Stallman2004-05-291-3/+12
| | | | | (syms_of_alloc): Defvar it. (Fgarbage_collect): Pass undo_outer_limit to truncate_undo_list.
* (lisp_align_malloc): Check for base == 0 regardless of HAVE_POSIX_MEMALIGN.Richard M. Stallman2004-05-291-2/+5
| | | | Clean up HAVE_POSIX_MEMALIGN handling of `err'.
* Undo Kim's recent changes and fix the same bug differently.Stefan Monnier2004-05-291-88/+32
| | | | | | | | | | (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.
* (struct backtrace): Remove.Stefan Monnier2004-05-281-26/+2
| | | | (Fgarbage_collect): Use the new mark_backtrace.
* (marker_blocks_pending_free): New var.Kim F. Storm2004-05-251-5/+24
| | | | | (gc_sweep): Store free marker blocks on that list. (Fgarbage_collect): Free them after undo-list cleanup.
* (Fmake_string): Doc fix.Richard M. Stallman2004-05-221-2/+3
|
* (struct backtrace): Add debug_on_exit member.Kim F. Storm2004-05-211-33/+36
| | | | | | | | | | | (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.
* (Fgarbage_collect): Do all the marking before flushingStefan Monnier2004-05-181-11/+11
| | | | unmarked elements of the undo list.
* (mark_object): Mark Lisp_Misc_Free cell. Fix comment.Kim F. Storm2004-05-171-4/+3
|
* (mark_object): Ignore Lisp_Misc_Free objects.Kim F. Storm2004-05-171-1/+10
| | | | Such objects may be freed markers which still exist on an undo list.
* (Fmake_bool_vector): Use BOOL_VECTOR_BITS_PER_CHAR instead ofAndreas Schwab2004-04-261-4/+5
| | | | BITS_PER_CHAR for bool vectors.
* (Fpurecopy): Declare size as EMACS_INT to not lose bits.Andreas Schwab2004-01-261-2/+3
|
* (lisp_malloc, lisp_align_malloc) [USE_LSB_TAG]:Stefan Monnier2004-01-211-0/+8
| | | | | Don't check range of malloc address. (pure_alloc) [USE_LSB_TAG]: Enforce alignment.
* (struct interval_block, struct string_block)Stefan Monnier2004-01-141-9/+18
| | | | | | | (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.
* * alloc.c (allocate_vectorlike): Surround calls to mallopt withJan Djärv2004-01-111-0/+4
| | | | BLOCK/UNBLOCK_INPUT.
* (make_float, Fcons): Clear the markbit at init time.Stefan Monnier2003-11-181-13/+12
| | | | | | (make_float, Fcons, Fmake_symbol, allocate_misc): Move the increment of block_index outside of the macro call. (Fgarbage_collect): Remove null code.
* (lisp_align_malloc): If BASE is 0, call memory_full.Richard M. Stallman2003-10-131-0/+5
|
* (GC_MALLOC_CHECK): Move conditional undef after lisp.h.Dave Love2003-09-191-7/+7
|
* (init_marker): Remove debugging code.Stefan Monnier2003-09-111-1/+0
|
* (init_intervals, init_symbol, init_marker): Don't preallocate anything.Stefan Monnier2003-09-111-55/+15
| | | | (Fgarbage_collect, mark_object): Ignore the markbit.
* Use long instead of int when casting ABLOCKS_BUSY toAndreas Schwab2003-09-071-7/+7
| | | | avoid warning.
* Add arch taglinesMiles Bader2003-09-011-0/+3
|
* (lisp_align_malloc): Change type of `aligned'.Dave Love2003-08-201-2/+3
|
* (lisp_align_malloc): Check for memory full whenGerd Moellmann2003-08-191-15/+17
| | | | | allocating ablocks, which also avoids freeing a pointer into an ablocks structure.