aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Avoid crashes with very wide TTY frames on MS-WindowsEli Zaretskii2018-08-251-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32console.c <glyph_base>: Reduce the number of elements to 80. <glyphs, glyphs_len>: New static variables. (w32con_clear_end_of_line): If the line is wider than the current size of the "empty row" in 'glyphs', reallocate 'glyphs' to support the full width of the frame. This avoids segfaults when the frame is wider than 256 columns. (Bug#32445)
| * | Update GNOME bugtracker URLsGlenn Morris2018-08-244-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | * configure.ac, admin/notes/multi-tty, etc/PROBLEMS: * src/emacs.c (main): * src/xterm.c (x_connection_closed): Update GNOME bugtracker URLs. ; * src/gtkutil.c (xg_display_close): ; * src/image.c (svg_load_image): Update URLs in comments.
| * | Port better to x86 -fexcess-precision=fastPaul Eggert2018-08-131-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem reported by Eli Zaretskii in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00380.html * src/data.c (arithcompare): Work around incompatibility between gcc -fexcess-precision=fast and the C standard on x86, by capturing the results of floating-point comparisons before the excess precision spontaneously decays. Although this fix might not work in general, it does work here and is probably good enough for the platforms we care about. (cherry picked from commit a84cef90957f2379cc0df6bd908317fc441971ce)
* | | Fix a typo in alloc.cEli Zaretskii2018-08-261-1/+1
| | | | | | | | | | | | | | | * src/alloc.c (Fmemory_use_counts): The list we return now has only 7 elements, not 8. (Bug#32531)
* | | Prefer CONSP etc. to XTYPEPaul Eggert2018-08-251-7/+7
| | | | | | | | | | | | | | | | | | | | | * src/nsmenu.m (process_dialog:): (initFromContents:isQuestion:): Prefer CONSP (x) to XTYPE (x) == Lisp_Cons, and similarly for STRINGP (x).
* | | Improve performance of CONSP, FIXNUMP, etc.Paul Eggert2018-08-251-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimization opportunity noted by Pip Cet in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00828.html On my platform (Fedora 28 x86-64, AMD Phenom II X4 910e, user+system time), this improved ‘make compile-always’ performance by 0.4% and shrank text size by a similar amount. * src/lisp.h (TAGGEDP, lisp_h_TAGGEDP): New macros and function. (lisp_h_CONSP, lisp_h_FLOATP, lisp_h_SYMBOLP) (lisp_h_VECTORLIKEP, make_lisp_ptr, STRINGP): Use them. (lisp_h_FIXNUMP): Use the same idea that lisp_h_TAGGEDP uses.
* | | Fix bugs when rounding to bignumsPaul Eggert2018-08-224-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, since Emacs historically reported a range error when rounding operations overflowed, do that consistently for all bignum overflows. * doc/lispref/errors.texi (Standard Errors): * doc/lispref/numbers.texi (Integer Basics): Document range errors. * src/alloc.c (range_error): Rename from integer_overflow. All uses changed. * src/floatfns.c (rounding_driver): When the result of a floating point rounding operation does not fit into a fixnum, put it into a bignum instead of always signaling an range error. * test/src/floatfns-tests.el (divide-extreme-sign): These tests now return the mathematically-correct answer instead of signaling an error. (bignum-round): Check that integers round to themselves.
* | | * src/buffer.h (DECODE_POSITION): Remove; unused.Paul Eggert2018-08-211-22/+0
| | |
* | | Add bignum support to floor, ceiling, etc.Paul Eggert2018-08-211-40/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem reported by Andy Moreton (Bug#32463#35 (d)). * src/floatfns.c (rounding_driver): Change the signature of the integer rounder to use mpz_t rather than EMACS_INT. All uses changed. Support bignums. (ceiling2, floor2, truncate2, round2): Remove. All uses changed to rounddiv_q or to a GMP library function. (rounddiv_q): New function. * test/src/floatfns-tests.el (bignum-round): New test.
* | | Move bignump, fixnump from C to LispPaul Eggert2018-08-211-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/objects.texi (Integer Type): Mention most-negative-fixnum and most-positive-fixnum as alternatives to fixnump and bignump. * lisp/subr.el (fixnump, bignump): Now written in Lisp. * src/data.c (Ffixnump, Fbignump): No longer written in C, as these new functions are not crucial for performance.
* | | Fix assertion failure when reading 'BIGNUM.'Paul Eggert2018-08-211-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | Problem reported by Stefan Monnier (Bug#32476). * src/lread.c (string_to_number): Don't pass leading "+" or trailing "." or junk to make_bignum_str. * test/src/lread-tests.el (lread-string-to-number-trailing-dot): New test.
* | | Fix bignum bugs with nth, elt, =Paul Eggert2018-08-213-29/+20
| | | | | | | | | | | | | | | | | | | | | | | | * src/bytecode.c (exec_byte_code): Support bignums when implementing nth, elt, and =. * src/lisp.h (SMALL_LIST_LEN_MAX): New constant. * src/fns.c (Fnthcdr): Use it. (Felt): Do not reject bignum indexes.
* | | Avoid libgmp aborts by imposing limitsPaul Eggert2018-08-215-84/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libgmp calls ‘abort’ when given numbers too big for its internal data structures. The numeric limit is large and platform-dependent; with 64-bit GMP 6.1.2 it is around 2**2**37. Work around the problem by refusing to call libgmp functions with arguments that would cause an abort. With luck libgmp will have a better way to do this in the future. Also, introduce a variable integer-width that lets the user control how large bignums can be. This currently defaults to 2**16, i.e., it allows bignums up to 2**2**16. This should be enough for ordinary computation, and should help Emacs to avoid thrashing or hanging. Problem noted by Pip Cet (Bug#32463#71). * doc/lispref/numbers.texi, etc/NEWS: Document recent bignum changes, including this one. Improve documentation for bitwise operations, in the light of bignums. * src/alloc.c (make_number): Enforce integer-width. (integer_overflow): New function. (xrealloc_for_gmp, xfree_for_gmp): Move here from emacs.c, as it's memory allocation. (init_alloc): Initialize GMP here, rather than in emacs.c. (integer_width): New var. * src/data.c (GMP_NLIMBS_MAX, NLIMBS_LIMIT): New constants. (emacs_mpz_size, emacs_mpz_mul) (emacs_mpz_mul_2exp, emacs_mpz_pow_ui): New functions. (arith_driver, Fash, expt_integer): Use them. (expt_integer): New function, containing integer code that was out of place in floatfns.c. (check_bignum_size, xmalloc_for_gmp): Remove. * src/emacs.c (main): Do not initialize GMP here. * src/floatfns.c (Fexpt): Use expt_integer, which now contains integer code moved from here. * src/lisp.h (GMP_NUMB_BITS): Define if gmp.h doesn’t.
* | | Fix glitches introduced by nthcdr changesPaul Eggert2018-08-211-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/fns.c (Fnthcdr): Fix recently-introduced bug when nthcdr is supposed to yield a non-nil non-cons. Reported by Glenn Morris and by Pip Cet here: https://lists.gnu.org/r/emacs-devel/2018-08/msg00699.html https://lists.gnu.org/r/emacs-devel/2018-08/msg00708.html Speed up nthcdr for small N, as suggested by Pip Cet here: https://lists.gnu.org/r/emacs-devel/2018-08/msg00707.html * test/src/fns-tests.el (test-nthcdr-simple): New test.
* | | Speed up (nthcdr N L) when L is circularPaul Eggert2018-08-201-6/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, fix bug when N is a positive bignum, a problem reported by Eli Zaretskii and Pip Cet in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00690.html * src/fns.c (Fnthcdr): If a cycle is found, reduce the count modulo the cycle length before continuing. This reduces the worst-case cost of (nthcdr N L) from N to min(N, C) where C is the number of distinct cdrs of L. Reducing modulo the cycle length also allows us to do arithmetic with machine words instead of with GMP. * test/src/fns-tests.el (test-nthcdr-circular): New test.
* | | Define get_proc_addr in Cygwin-w32 buildAndy Moreton2018-08-2010-33/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32common.h (get_proc_addr, DEF_DLL_FN, LOAD_DLL_FN): Move definitions here from src/w32.h. * src/decompress.c [WINDOWSNT]: * src/gnutls.c [WINDOWSNT]: * src/image.c [WINDOWSNT]: * src/json.c [WINDOWSNT]: * src/lcms.c [WINDOWSNT]: * src/w32font.c [WINDOWSNT]: * src/w32uniscribe.c: * src/xml.c [WINDOWSNT]: Include w32common.h.
* | | nthcdr now works with bignumsPaul Eggert2018-08-201-2/+13
| | | | | | | | | | | | | | | | | | Problem reported by Karl Fogel in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00671.html * src/fns.c (Fnthcdr): Support bignum counts.
* | | Fix expt signedness bug --without-wide-intPaul Eggert2018-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Problem reported by Federico in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00619.html * src/floatfns.c (Fexpt): Use TYPE_RANGED_FIXNUMP, not RANGED_FIXNUMP, to fix bug with unsigned comparison on platforms built --without-wide-int.
* | | Add bignum support to exptPaul Eggert2018-08-191-20/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem and initial solution reported by Andy Moreton in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00503.html * doc/lispref/numbers.texi (Math Functions): expt integer overflow no longer causes truncation; it now signals an error since bignum overflow is a big deal. * src/floatfns.c (Fexpt): Support bignum arguments. * test/src/floatfns-tests.el (bignum-expt): New test.
* | | Fix bug with ‘mod’ and float+bignumPaul Eggert2018-08-181-4/+2
| | | | | | | | | | | | | | | | | | | | | Problem reported by Andy Moreton in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00442.html * src/floatfns.c (fmod_float): Work even if an arg is a bignum. * test/src/floatfns-tests.el (bignum-mod): New test.
* | | Tweak integer divisionPaul Eggert2018-08-181-8/+5
| | | | | | | | | | | | | | | | | | * src/data.c (arith_driver): Reorder to remove unnecessary FIXNUMP. Tighten test for whether to convert the divisor from fixnum to mpz_t. Simplify.
* | | Simplify float_arith_driverPaul Eggert2018-08-181-16/+4
| | | | | | | | | | | | | | | * src/data.c (float_arith_driver): Simplify, as we needn’t worry about that 30-year-old compiler bug any more.
* | | Minor fixups for intmax_t→mpz_t conversionPaul Eggert2018-08-183-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (mpz_set_intmax_slow): Tighten assertion. Work even in the unlikely case where libgmp uses nails. * src/data.c (FIXNUMS_FIT_IN_LONG): New constant. (arith_driver): Use it to tighten compile-time checks. * src/lisp.h (mpz_set_intmax): Do not assume that converting an out-of-range value to ‘long’ is harmless, as it might raise a signal. Use simpler expression; compiler can optimize.
* | | Improve --with-wide-int mpz_t→fixnum conversionPaul Eggert2018-08-181-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tuneups and minor simplifications should affect only platforms with EMACS_INT wider than ‘long’. * src/alloc.c (make_number): If the number fits in long but not in fixnum, do not attempt to convert to fixnum again. Tighten the compile-time check for whether the second attempt is worth trying, from sizeof (long) < sizeof (EMACS_INT) to LONG_WIDTH < FIXNUM_BITS. Do not bother computing the sign of the value to tighten the bounds for whether to try the second attempt, as it’s not worth the effort. Do not call mpz_size, which is unnecessary since the number of bits is already known and the loop can iterate over a shift count instead. Avoid unnecessary casts. Use + instead of | where either will do, as + is typically better for optimization. Improve mpz_t to fixnum when --with-wide-int * src/alloc.c (make_number): Avoid undefined behavior when shifting an EMACS_UINT by more than EMACS_UINT_WIDTH bits. Check for integer overflow when shifting.
* | | Improve bignum comparison (Bug#32463#50)Paul Eggert2018-08-181-125/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/data.c (isnan): Remove, as we can assume C99. (bignumcompare): Remove, folding its functionality into arithcompare. (arithcompare): Compare bignums directly here. Fix bugs when comparing NaNs to bignums. When comparing a bignum to a fixnum, just look at the bignum’s sign, as that’s all that is needed. Decrease scope of locals when this is easy. * test/src/data-tests.el (data-tests-bignum): Test bignum vs NaN.
* | | Document that ‘random’ is limited to fixnumsPaul Eggert2018-08-181-6/+3
| | | | | | | | | | | | | | | | | | Problem reported by Pip Cet (Bug#32463#20). * doc/lispref/numbers.texi (Random Numbers): * src/fns.c (Frandom): Adjust doc.
* | | Restore traditional lsh behavior on fixnumsPaul Eggert2018-08-181-36/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/numbers.texi (Bitwise Operations): Document that the traditional (lsh A B) behavior is for fixnums, and that it is an error if A and B are both negative and A is a bignum. See Bug#32463. * lisp/subr.el (lsh): New function, moved here from src/data.c. * src/data.c (ash_lsh_impl): Remove, moving body into Fash since it’s the only caller now. (Fash): Check for out-of-range counts. If COUNT is zero, return first argument instead of going through libgmp. Omit lsh code since lsh is now done in Lisp. Add code for shifting fixnums right, to avoid a round trip through libgmp. (Flsh): Remove; moved to lisp/subr.el. * test/lisp/international/ccl-tests.el (shift): Test for traditional lsh behavior, instead of assuming lsh is like ash when bignums are present. * test/src/data-tests.el (data-tests-logand) (data-tests-logior, data-tests-logxor, data-tests-ash-lsh): New tests.
* | | Avoid compilation warning in w32fns.cEli Zaretskii2018-08-181-5/+2
| | | | | | | | | | | | | | | | | | * src/w32fns.c (Fw32_read_registry): Avoid compiler warning regarding possible use of 'rootkey' without initializing it first. Reported by Andy Moreton <andrewjmoreton@gmail.com>.
* | | Improve ‘abs’ performancePaul Eggert2018-08-171-17/+30
| | | | | | | | | | | | | | | | | | * src/floatfns.c (Fabs): Improve performance by not copying the argument if it would eql the result. As a minor detail, don't assume fixnums are two’s complement.
* | | Pacify -Wcast-function-type warnings in GCC 8.1Andy Moreton2018-08-1710-161/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/image.c: Move attributes into DEF_DLL_FN call. * src/dynlib.c (dynlib_addr): Use get_proc_addr. * src/w32.h: (get_proc_addr): New function. (LOAD_DLL_FN): Use it. (DEF_DLL_FN): Allow function attributes after argument list. Add function pointer type used by LOAD_DLL_FN. * src/w32.c (open_process_token, get_token_information) (lookup_account_sid, get_sid_sub_authority) (get_sid_sub_authority_count, get_security_info) (get_file_security, set_file_security) (set_named_security_info) (get_security_descriptor_owner, get_security_descriptor_group) (get_security_descriptor_dacl, is_valid_sid, equal_sid) (get_length_sid, copy_sid, get_native_system_info) (get_system_times, create_symbolic_link) (is_valid_security_descriptor, convert_sd_to_sddl) (convert_sddl_to_sd, get_adapters_info, reg_open_key_ex_w) (reg_query_value_ex_w, expand_environment_strings_w) (init_environment, create_toolhelp32_snapshot) (process32_first, process32_next, open_thread_token) (impersonate_self, revert_to_self, get_process_memory_info) (get_process_working_set_size, global_memory_status) (global_memory_status_ex, init_winsock) (maybe_load_unicows_dll, globals_of_w32): Use get_proc_addr. * src/w32fns.c (setup_w32_kbdhook, Ffile_system_info) (get_dll_version, w32_reset_stack_overflow_guard) (w32_backtrace, globals_of_w32fns): Use get_proc_addr. * src/w32font.c (get_outline_metrics_w, get_text_metrics_w) (get_glyph_outline_w, get_char_width_32_w): Use get_proc_addr. * src/w32heap.c (init_heap): Use get_proc_addr. * src/w32menu.c (globals_of_w32menu): Use get_proc_addr. * src/w32proc.c (init_timers, sys_kill, w32_compare_strings): Use get_proc_addr. * src/w32uniscribe.c (syms_of_w32uniscribe): Use get_proc_addr.
* | | Fix problems with logxor etc. and fixnumsPaul Eggert2018-08-173-33/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These operations incorrectly treated negative fixnums as bignums greater than most-positive-fixnum. * src/alloc.c (mpz_set_intmax_slow): Avoid undefined behavior if signed unary negation overflows, while we’re in the neighborhood. (mpz_set_uintmax_slow): Remove. All uses removed. * src/data.c (arith_driver): Treat fixnums as signed, not unsigned, even for logical operations. * src/lisp.h (mpz_set_uintmax): Remove. All uses removed. * test/src/data-tests.el (data-tests-logand) (data-tests-logior, data-tests-logxor): New tests.
* | | Reject outlandishly-wide bignumsPaul Eggert2018-08-161-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Do not allow bignums that are so wide that their log base 2 might not fit into a fixnum, as this will cause problems elsewhere. We already have a similar limitation for bool-vectors. * src/emacs.c (check_bignum_size, xmalloc_for_gmp): New function. (xrealloc_for_gmp): Check for too-large bignum. (main): Use xmalloc_for_gmp.
* | | Speed up logcount on bignumsPaul Eggert2018-08-161-2/+1
| | | | | | | | | | | | | | | * src/data.c (Flogcount): Speed up by using the mpz equivalent of ~X instead of -X-1.
* | | Pacify GCC with -Wunused-but-set-variableKen Brown2018-08-161-3/+3
| | | | | | | | | | | | | | | | | | | | | * src/unexcw.c (read_exe_header): (fixup_executable): (unexec): Specify the "unused" attribute for variables that are used only in assertions.
* | | Remove more traces of misc (Bug#32405)Paul Eggert2018-08-141-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove misc-objects-consed and the misc component of memory-use-count, since misc objects no longer exist. * doc/lispref/internals.texi, etc/NEWS: Mention this, and adjust better to recent removal of misc objects. * src/alloc.c (MEM_TYPE_MISC): Remove; no longer used. (Fmemory_use_counts): Omit misc count, since miscs no longer exist. (misc-objects-consed): Remove.
* | | Merge from origin/emacs-26Glenn Morris2018-08-141-4/+0
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | 614cc65 ; * lisp/simple.el (line-move-visual): Fix typo. d2ad4ba Do not consider external packages to be removable (Bug#27822) ec0995c * src/alloc.c: Remove obsolete comments. ec6f588 Better support utf-8-with-signature and utf-8-hfs in HTML eb026a8 Don't use -Wabi compiler option
| * | * src/alloc.c: Remove obsolete comments.Paul Eggert2018-08-111-4/+0
| | |
* | | Port recent changes to older GCCPaul Eggert2018-08-141-1/+2
| | | | | | | | | | | | | | | | | | | | | Problem reported by Glenn Morris in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00446.html * src/lisp.h (make_pointer_integer_unsafe): Port to older GCC.
* | | Update doc strings for fixnum constantsPaul Eggert2018-08-131-2/+2
| | | | | | | | | | | | | | | * src/data.c (most-positive-fixnum, most-negative-fixnum): Update doc strings in the light of fixnums.
* | | Fix check for unsafe watch descriptorPaul Eggert2018-08-132-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | * src/lisp.h (make_pointer_integer_unsafe): New function. (make_pointer_integer): Use it. * src/gfilenotify.c (dir_monitor_callback): Omit redundant eassert. (Fgfile_add_watch): Signal an error instead of failing an assertion if the pointer does not work.
* | | Pacify gcc -Og -WuninitializedPaul Eggert2018-08-128-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses the -Og uninitialized variable warnings I ran into on Fedora 28, which uses 8.1.1 20180712 (Red Hat 8.1.1-5). It also changes some explicit initializations to UNINIT when the variable does not actually need to be initialized. * src/process.c (connect_network_socket): * src/sysdep.c (system_process_attributes): * src/xfns.c (x_real_pos_and_offsets): * src/xterm.c (get_current_wm_state) [USE_XCB]: Add UNINIT. * src/editfns.c (tzlookup): * src/fns.c (Fnconc): * src/font.c (font_parse_fcname): * src/frame.c (x_set_frame_parameters): Prefer UNINIT to explicit initialization.
* | | Port better to x86 -fexcess-precision=fastPaul Eggert2018-08-121-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem reported by Eli Zaretskii in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00380.html * src/data.c (arithcompare): Work around incompatibility between gcc -fexcess-precision=fast and the C standard on x86, by capturing the results of floating-point comparisons before the excess precision spontaneously decays. Although this fix might not work in general, it does work here and is probably good enough for the platforms we care about.
* | | Adjust .gdbinit to removal of misc objectsPaul Eggert2018-08-121-37/+9
| | | | | | | | | | | | | | | * src/.gdbinit (xtype, xpr): Adjust. (xmisctype, xmiscfree): Remove.
* | | Make mini-gmp safe for --enable-gcc-warningsPaul Eggert2018-08-122-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (GMP_OBJ): When building mini-gmp, compile mini-gmp-emacs.c, not mini-gmp.c. * lib-src/etags.c (NDEBUG): Don't attempt to redefine, in case the builder compiles with -DNDEBUG. * src/conf_post.h (NDEBUG) [!ENABLE_CHECKING && !NDEBUG]: Define. This avoids bloat in mini-gmp-emacs.o. * src/mini-gmp-emacs.c: New file, which pacifies --enable-gcc-warnings.
* | | ; Avoid compilation warnings under -OgEli Zaretskii2018-08-125-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32.c (w32_read_registry): * src/font.c (font_parse_fcname): * src/fns.c (Fnconc): * src/editfns.c (tzlookup): * src/frame.c (x_set_frame_parameters): Avoid compiler warnings about maybe-uninitialized variables.
* | | Ensure no padding after union vectorlike_headerAndreas Schwab2018-08-121-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of increasing GCALIGNMENT align union vectorlike_header by adding a Lisp_Object member. * src/lisp.h (GCALIGNMENT): Revert last change. (union vectorlike_header): Add align member. (header_size): Verify the same as sizeof (union vectorlike_header)
* | | Avoid padding after union vectorlike_headerAndreas Schwab2018-08-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | The PSEUDOVECTORSIZE macro requires that the first member after union vectorlike_header has the same offset in all pseudo vector structures. * src/lisp.h (GCALIGNMENT) [!USE_LSB_TAG]: Use alignment of Lisp_Object.
* | | Simplify mark_object for pseudovectorsPaul Eggert2018-08-112-19/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by Pip Cet (Bug#32405#14). * src/alloc.c (mark_object): Remove unnecessary special cases for PVEC_MARKER, PVEC_BOOL_VECTOR, PVEC_MISC_PTR, PVEC_USER_PTR, and PVEC_FINALIZER. change is to free up an enum Lisp_Type tag value, a scarce
* | | Turn misc objects into pseudovectorsPaul Eggert2018-08-119-806/+395
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate the category of miscellaneous objects, and turn all such objects into pseudovectors. The immediate motivation for this change is to free up an enum Lisp_Type tag value, a scarce resource that can be better used elsewhere. However, this change is worthwhile in its own right, as it improves performance slightly on my platform, 0.3% faster for 'make compile-always' on Fedora 28, and it simplifies the garbage collector and interpreter (Bug#32405). * doc/lispref/internals.texi (Garbage Collection): * etc/NEWS: Document change to garbage-collect return value. * src/alloc.c (total_markers, total_free_markers): (union aligned_Lisp_Misc, MARKER_BLOCK_SIZE) (struct marker_block, marker_block, marker_block_index) (misc_free_list, allocate_misc, live_misc_holding) (live_misc_p, sweep_misc): * src/lisp.h (lisp_h_MARKERP, lisp_h_MISCP, MARKERP, MISCP) (Lisp_Misc, enum Lisp_Misc_Type, Lisp_Misc_Free) (Lisp_Misc_Marker, Lisp_Misc_Overlay, Lisp_Misc_Finalizer) (Lisp_Misc_Ptr, Lisp_Misc_User_Ptr, Lisp_Misc_Limit) (Lisp_Misc_Bignum) (XSETMISC, struct Lisp_Misc_Any, XMISCANY, XMISCTYPE) (struct Lisp_Free, union Lisp_Misc, XMISC): Remove. All uses removed. (cleanup_vector): Clean up objects that were formerly misc and are now pseudovectors. (make_misc_ptr, build_overlay, Fmake_marker, build_marker) (make_bignum_str, make_number, make_pure_bignum) (make_user_ptr, Fmake_finalizer): Build as pseudovectors, not as misc objects. (mark_finalizer_list, queue_doomed_finalizers) (compact_undo_list, mark_overlay, mark_object) (unchain_dead_markers): Mark as vector-like objects, not as misc objects. (mark_maybe_object, mark_maybe_pointer, valid_lisp_object_p) (total_bytes_of_live_objects, survives_gc_p): * src/fns.c (sxhash): No need to worry about misc objects. (garbage_collect_1): Do not generate a 'misc' component. (syms_of_alloc): No need for 'misc' symbol. * src/buffer.c (overlays_at, overlays_in, overlay_touches_p) (overlay_strings, recenter_overlay_lists) (fix_start_end_in_overlays, fix_overlays_before) (Foverlay_lists, report_overlay_modification) (evaporate_overlays): * src/editfns.c (overlays_around): * src/data.c (Ftype_of): * src/fns.c (internal_equal): * src/lisp.h (mint_ptrp, xmint_pointer, FINALIZERP) (XFINALIZER, MARKERP, XMARKER, OVERLAYP, XOVERLAY, USER_PTRP) (XUSER_PTR, BIGNUMP, XBIGNUM): * src/print.c (print_vectorlike, print_object): * src/undo.c (record_marker_adjustments): * src/xdisp.c (load_overlay_strings): Formerly misc objects are now pseudovectors. * src/lisp.h (PVEC_MARKER, PVEC_OVERLAY, PVEC_FINALIZER) (PVEC_BIGNUM, PVEC_MISC_PTR, PVEC_USER_PTR): New constants, replacing their misc versions. All uses changed. (struct Lisp_Marker, struct Lisp_Overlay, struct Lisp_Misc_Ptr) (struct Lisp_Bignum, struct Lisp_User_Ptr, struct Lisp_Finalizer): Make usable as a pseudovector by using a pseudovector header, replacing any DIY components, and putting Lisp_Object members first. All uses changed.
* | | Pacify Oracle Studio 12.6Paul Eggert2018-08-112-11/+4
| | | | | | | | | | | | | | | * src/xfns.c (Fx_frame_restack): * src/xterm.c (x_io_error_quitter): Omit unreachable code.