aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* (Fmake_list): Add a QUIT in the loop; unroll the loop.Gerd Moellmann2001-01-311-2/+32
|
* * alloc.c (allocate_string) [macintosh]: Call check_string_bytesAndrew Choi2001-01-281-1/+5
| | | | | | | | | | | | | | | | | | | | only if current_sblock has been initialized. * frame.c (Fdelete_frame) [macintosh]: Allow deletion of initial terminal frame even if it is the only visible frame. * src/macfns.c (QCconversion): Replaces QCalgorithm. * src/macfns.c (image_ascent, lookup_image): Adapt to change of image margins. * src/macterm.c (x_produce_image_glyph, x_draw_image_foreground) (x_draw_image_relief, x_draw_image_foreground_1) (x_draw_image_glyph_string): Adapt to change of image margins. * src/macterm.c (mac_to_x_fontname): Change charset name of Simplify Chinese fonts from gb2312 to gb2312.1980 and Korean fonts from ksc5601 to ksc5601.1989.
* (CHECK_STRING_BYTES) [GC_CHECK_STRING_BYTES]: New macro.Gerd Moellmann2001-01-091-50/+88
| | | | | | | | | | | (check_sblock, string_bytes) [GC_CHECK_STRING_BYTES]: New functions. (check_string_bytes) [GC_CHECK_STRING_BYTES]: Add parameter ALL_P. (allocate_string) [GC_CHECK_STRING_BYTES]: Always check strings in the current sblock. (mark_object) [GC_CHECK_STRING_BYTES]: Use CHECK_STRING_BYTES. (gc_sweep) [GC_CHECK_STRING_BYTES]: Call check_string_bytes after sweeping strings, and at the end. (GC_CHECK_STRING_BYTES): Moved to lisp.h.
* (Fgarbage_collect): Use a record_unwind_protect toGerd Moellmann2001-01-091-2/+4
| | | | ensure that pop_message is called.
* (gc_sweep): Add comment.Stefan Monnier2000-12-071-0/+3
|
* (gc_sweep): Prevent symbols read during loadupGerd Moellmann2000-12-061-17/+24
| | | | from being freed.
* (Fgarbage_collect): Dox fix. Return a list asGerd Moellmann2000-12-061-8/+8
| | | | advertized by the function documentation.
* (Fmake_string): Use MAX_MULTIBYTE_LENGTH, instead of hard coded `4'.Kenichi Handa2000-11-231-1/+1
|
* (mark_object) <frame>: Mark tool bar items differently.Gerd Moellmann2000-11-221-2/+1
|
* (make_string): Fix previous change. Be sure to makeKenichi Handa2000-11-201-3/+3
| | | | unibyte string correctly.
* (emacs_blocked_free) [GC_MALLOC_CHECK]: Handle freeingGerd Moellmann2000-10-231-15/+16
| | | | null.
* (toplevel): Conditionalize compilation of mem_*Gerd Moellmann2000-10-201-1/+6
| | | | functions differently.
* Move #ifdef GC_MARK_STACK back above mem_init where it used to be. mem_z etc ↵Jason Rumney2000-10-201-2/+1
| | | | | | not defined otherwise.
* (toplevel) [SYSTEM_MALLOC || DOUG_LEA_MALLOC]: UndefGerd Moellmann2000-10-201-64/+177
| | | | | | | | | | | | | | | | | GC_MALLOC_CHECK. (toplevel) [GC_MARK_STACK || GC_MALLOC_CHECK]: Move mem_node structure definition and related variabled to the top of the file. Include this code when GC_MALLOC_CHECK is defined. (lisp_malloc, lisp_free) [GC_MALLOC_CHECK]: Don't register/unregister allocated region. (emacs_blocked_free) [GC_MALLOC_CHECK]: Check if freeing something which isn't allocated. (emacs_blocked_malloc) [GC_MALLOC_CHECK]: Check if returning something which is already in use. (emacs_blocked_realloc) [GC_MALLOC_CHECK]: Likewise. (mem_insert) [GC_MALLOC_CHECK]: Use _malloc_internal. (mem_delete) [GC_MALLOC_CHECK]: Use _free_internal. (init_alloc_once) [GC_MALLOC_CHECK]: Call mem_init.
* (allocate_string) [GC_CHECK_STRING_BYTES]: CallGerd Moellmann2000-10-181-1/+1
| | | | check_string_bytes only if not noninteractive, increase count to 50.
* (pure_bytes_used): Renamed from pureptr.Gerd Moellmann2000-10-171-75/+78
| | | | | | | | (ALIGN): New macro. (pure_alloc): New function. (make_pure_string, pure_cons, make_pure_float, make_pure_vector): Use it. (Fpurecopy): Use PURE_POINTER_P.
* (mark_object) [GC_CHECK_STRING_BYTES]: Check validity ofGerd Moellmann2000-10-171-0/+68
| | | | | | | | string's size_byte. (check_string_bytes) [GC_CHECK_STRING_BYTES]: New function. (check_string_bytes_count) [GC_CHECK_STRING_BYTES]: New variable. (allocate_string) [GC_CHECK_STRING_BYTES]: Call it for every 10th string allocated.
* (mark_object): Remove all workarounds installed onAndreas Schwab2000-10-101-29/+9
| | | | 1993-08-08.
* (Fgarbage_collect): Prevent compiler warning for a callEli Zaretskii2000-10-031-1/+3
| | | | to `mark_object'.
* (GC_CHECK_STRING_BYTES): Temporarily define, for bugGerd Moellmann2000-09-261-4/+66
| | | | | | | | | | | | | | hunting. (struct sdata) [GC_CHECK_STRING_BYTES]: Always record the string's size in the sdata structure. (SDATA_NBYTES, SDATA_DATA): New macros. (SDATA_OF_STRING, SDATA_SIZE) [GC_CHECK_STRING_BYTES]: Define differently for the different layout of the sdata structure. (allocate_string_data) [GC_CHECK_STRING_BYTES]: Record string size in sdata. (sweep_strings, compact_small_strings) [GC_CHECK_STRING_BYTES]: Check that size recorded in the string size and size recorded in the sdata structure agree.
* (__malloc_size_t) [DOUG_LEA_MALLOC]: Don't redefine it.Dave Love2000-09-251-7/+5
| | | | | | (__malloc_size_t) [!DOUG_LEA_MALLOC]: Define unconditionally as size_t. (__malloc_extra_blocks): Declare as __malloc_size_t.
* (mark_image): Use GC_NILP instead of NILP.Gerd Moellmann2000-09-251-1/+1
|
* Avoid some more compiler warnings.Gerd Moellmann2000-09-211-3/+6
|
* Add some comments about DOUG_LEA_MALLOC's use of mmapGerd Moellmann2000-09-131-2/+6
| | | | and allocation of Lisp data.
* Include keyboard.h before frame.h.Andrew Innes2000-08-221-1/+1
|
* (lisp_malloc): Declare with POINTER_TYPE.Dave Love2000-08-171-7/+7
| | | | | [SYSTEM_MALLOC]: Make decls in malloc.h conditional on DOUG_LEA_MALLOC.
* (compact_small_strings): Use safe_bcopy, add anGerd Moellmann2000-08-151-1/+2
| | | | assertion.
* [HAVE_UNISTD_H]: Include unistd.h; don't declare sbrk.Dave Love2000-08-141-2/+7
| | | | | [!HAVE_UNISTD_H]: Use POINTER_TYPE to declare sbrk. (lisp_free): Declare and make static.
* (lisp_malloc, lisp_free): Use size_t and POINTER_TYPE.Gerd Moellmann2000-08-021-14/+16
| | | | (xrealloc, xmalloc): Use size_t.
* (allocate_string_data): Don't copy old string contents.Gerd Moellmann2000-07-191-2/+1
|
* (allocate_string_data): If string had already dataGerd Moellmann2000-07-181-12/+15
| | | | assigned, copy old contents to new string data.
* (xmalloc, xrealloc, xfree): Define using POINTER_TYPE.Dave Love2000-06-201-9/+9
|
* (mark_object) [GC_CHECK_MARKED_OBJECTS]: Check that noGerd Moellmann2000-06-191-2/+81
| | | | | | bogus objects are marked. This slows down GC by ~80 percent, but it might be worth trying when debugging GC-related problems. This feature requires conservative stack marking to be enabled.
* (Fmake_byte_code): If BYTECODE-STRING is multibyte,Kenichi Handa2000-05-191-2/+15
| | | | | convert it to unibyte. (make_string): Use parse_str_as_multibyte, not chars_in_text.
* * alloc.c (MARK_STRING, UNMARK_STRING, STRING_MARKED_P): Expand non-union-typeKen Raeburn2000-04-021-4/+17
| | | | | | versions of XMARK and friends here, because XMARK and friends won't work on an integer field if NO_UNION_TYPE is not defined. (make_number): Define as a function if it's not defined as a macro.
* (xstrdup): Moved here from xfaces.c.Gerd Moellmann2000-03-301-14/+17
| | | | | | (allocating_for_lisp): Variable removed. (lisp_malloc): Block input around the calls to malloc and mem_insert.
* Stop assuming interval pointers and lisp objects can be distinguished byKen Raeburn2000-03-291-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | inspection. Beginnings of support for expensive internal consistency checks. * config.in (ENABLE_CHECKING): Undef. * lisp.h (struct interval): Replace "parent" field with a union of interval pointer and Lisp_Object; add new bitfield to use as discriminant. Change other flag fields to bitfields. (CHECK): New macro for consistency checking. If ENABLE_CHECKING is defined and the supplied test fails, print a message and abort. (eassert): New macro. Use CHECK to provide an assert-like facility. * intervals.h (NULL_INTERVAL_P): Now applies only to real interval pointers; abort if the value looks like a lisp object. (NULL_INTERVAL_P, NULL_PARENT, HAS_PARENT, HAS_OBJECT, SET_PARENT, SET_OBJECT, INTERVAL_PARENT, GET_INTERVAL_OBJECT, COPY_PARENT): Modify for new interval parent definition. * alloc.c (mark_interval_tree, MARK_INTERVAL_TREE, UNMARK_BALANCE_INTERVALS): Update references that need an addressable lisp object in the interval structure. (die): New function. (suppress_checking): New variable. * intervals.c (interval_start_pos): Just return 0 if there's no parent object.
* Include stdio.h. Test STDC_HEADERS, not __STDC__.Dave Love2000-03-281-1/+2
|
* (mark_maybe_object): New function.Gerd Moellmann2000-03-271-75/+234
| | | | | | | | | (mark_memory): Use it. (SETJMP_WILL_LIKELY_WORK, SETJMP_WILL_NOT_WORK): New macros. (setjmp_tested_p, longjmp_done): New variables. (test_setjmp): New function. (mark_stack) [!GC_SETJMP_WORKS]: Call test_setjmp. (init_alloc): Initialize setjmp_tested_p and longjmp_done.
* Changes towards better type safety regarding intervals, primarilyKen Raeburn2000-03-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regarding the "parent" handle. These just separate out the different usages based on the type of parent (interval vs lisp object); later changes will do type checking and enforcement. * intervals.h (NULL_INTERVAL): Cast to INTERVAL type. (INT_LISPLIKE): New macro. (NULL_INTERVAL_P): Use it. (INTERVAL_HAS_PARENT, INTERVAL_HAS_OBJECT, SET_INTERVAL_PARENT, SET_INTERVAL_OBJECT, INTERVAL_PARENT, COPY_INTERVAL_PARENT, GET_INTERVAL_OBJECT, INTERVAL_PARENT_OR_NULL): New macros. * alloc.c (make_interval, gc_sweep): Use new macros; eliminate all explicit references to "parent" field of struct interval and associated unclean type conversions. * intervals.c (create_root_interval, root_interval, rotate_right, rotate_left, balance_possible_root_interval, split_interval_right, split_interval_left, interval_start_pos, find_interval, next_interval, previous_interval, update_interval, adjust_intervals_for_insertion, delete_node, delete_interval, adjust_intervals_for_deletion, merge_interval_right, merge_interval_left, reproduce_tree, graft_intervals_into_buffer, copy_intervals_to_string): Likewise. * intervals.h (AM_LEFT_CHILD, AM_RIGHT_CHILD, RESET_INTERVAL): Likewise. * syntax.c (update_syntax_table): Likewise. * intervals.c (reproduce_tree_obj): New function, like reproduce_tree but takes a Lisp_Object for the parent. Declare with prototype. (graft_intervals_into_buffer): Use it when appropriate. (reproduce_tree): Declare with prototype. (balance_possible_root_interval): Check that the parent is a lisp object before trying to examine its type.
* (mark_face_cache): Don't mark face->registry.Kenichi Handa2000-03-211-1/+0
|
* (enum mem_type): Compile unconditionally.Gerd Moellmann2000-02-171-12/+11
|
* (mark_object): Don't mark symbol names in pure space.Gerd Moellmann2000-02-171-129/+1169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (gc_sweep): Don't unmark symbol names in pure space. (toplevel): Include setjmp.h. (PURE_POINTER_P): New define. (enum mem_type) [GC_MARK_STACK]: New enumeration. (Vdead) [GC_MARK_STACK]: New variable. (lisp_malloc): Add parameter TYPE, call mem_insert if GC_MARK_STACK is defined. (allocate_buffer): New function. (lisp_free) [GC_MARK_STACK]: Call mem_delete. (free_float) [GC_MARK_STACK]: Set type to Vdead. (free_cons) [GC_MARK_STACK]: Set car to Vdead. (stack_base, mem_root, mem_z) [GC_MARK_STACK]: New variables. (MEM_NIL) [GC_MARK_STACK]: New define. (struct mem_node) [GC_MARK_STACK]: New structure. (mem_init, mem_find, mem_insert, mem_delete, mem_insert_fixup) (mem_delete_fixup, mem_rotate_left, mem_rotate_right) (live_string_p, live_cons_p, live_symbol_p, live_float_p) (live_misc_p, live_vector_p, live_buffer_p, mark_memory) (mark_stack) [GC_MARK_STACK]: New functions. (Fgarbage_collect) [GC_MARK_STACK]: Call mark_stack. (clear_marks): Removed. (gc_sweep): Set free conses' car, free floats' type, free symbols' function to Vdead. Use lisp_free to free buffers. (init_alloc_once): Initialize Vdead. (survives_gc_p): Return non-zero for pure objects. Add comments throughout the file.
* Remove `LISP_FLOAT_TYPE' and `standalone'.Gerd Moellmann2000-02-171-23/+0
|
* (purecopy): Doc fix.Dave Love2000-01-171-1/+1
|
* (Fgarbage_collect): Return number of live and freeGerd Moellmann2000-01-041-790/+998
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strings. (mark_buffer): Remove code in #if 0. (gc_sweep): Ditto. (UNMARK_BALANCE_INTERVALS): Give the macro statement form. (strings_consed): New variable. (allocate_string): Set it. (syms_of_alloc): Add DEFVAR_INT for strings_consed. (Fmemory_use_counts): Return strings_consed. Use Flist. General cleanup in comments etc. Remove conditional compilation for `standalone'. (MARK_STRING, UNMARK_STRING, STRING_MARKED_P): (GC_STRING_BYTES, GC_STRING_CHARS): New macros. (DONT_COPY_FLAG): Removed. (SBLOCK_SIZE, LARGE_STRING_BYTES): New macros. (struct sdata, struct sblock): New (struct string_block): Rewritten. (STRINGS_IN_STRING_BLOCK): New macro. (oldest_sblock, current_sblock, total_strings, total_free_strings) (large_sblocks, string_blocks, string_free_list): New variables. (NEXT_FREE_LISP_STRING, SDATA_OF_STRING, SDATA_SIZE): New macros. (init_strings): Rewritten. (allocate_string, allocate_string_data, compact_small_strings) (free_large_strings, sweep_strings): New functions. (STRING_BLOCK_SIZE, STRING_BLOCK_OUTSIZE) (struct string_block_head, current_string_block) (first_string_block, large_string_blocks, STRING_FULLSIZE) (STRING_PAD): Removed. (make_uninit_multibyte_string, make_pure_string): Rewritten. (Fgarbage_collect): Don't set mark bit in large strings. (mark_object): Mark strings differently. Mark symbol names differently. (survives_gc_p): Test marked strings differently. (gc_sweep): Sweep strings differently, unmark strings in symbol names. (compact_strings): Removed.
* Comment change.Richard M. Stallman1999-12-281-2/+4
|
* (Fmake_string): Adjusted for the change of CHAR_STRING.Kenichi Handa1999-12-151-2/+2
|
* (Fgarbage_collect): Call unmark_byte_stack.Gerd Moellmann1999-11-071-1/+1
|
* Remove conditional compilation on USE_TEXT_PROPERTIES.Gerd Moellmann1999-11-071-19/+0
|