aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | Use float instead of Lisp_Object for rehash_sizePaul Eggert2017-02-219-76/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (purecopy_hash_table): * src/fns.c (maybe_resize_hash_table, Fmake_hash_table): (Fhash_table_rehash_size): * src/lisp.h (struct Lisp_Hash_Table.rehash_size): The rehash_size member of struct Lisp_Hash_Table is now a float, not a Lisp_Object. * src/alloc.c (purecopy_hash_table): Assign members in order. * src/fns.c (make_hash_table): Use EMACS_INT for size and float for rehash_size, instead of Lisp_Object for both. All callers changed. * src/lisp.h (DEFAULT_REHASH_SIZE): Now float, not double, and 1 smaller. * src/print.c (print_object): Simplify by calling Fhash_table_rehash_size and Fhash_table_rehash_threshold. Avoid unnecessary NILP.
* | Use ptrdiff_t instead of Lisp_Object for collisionPaul Eggert2017-02-214-103/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (purecopy_hash_table): Assign, don’t purecopy. * src/fns.c (set_hash_next_slot, set_hash_index_slot): Hash index arg is now ptrdiff_t index (or -1 if empty), not Lisp_Object integer (or Qnil if empty). All callers changed. (larger_vecalloc): New static function. (larger_vector): Use it. (HASH_NEXT, HASH_INDEX): Move here from lisp.h. Return ptrdiff_t index (or -1) not Lisp_Object integer (or Qnil). All callers changed. * src/fns.c (make_hash_table, maybe_resize_hash_table, hash_lookup) (hash_put, hash_remove_from_table, hash_clear, sweep_weak_table): * src/profiler.c (evict_lower_half, record_backtrace): -1, not nil, is now the convention for end of collision list. * src/fns.c (maybe_resize_hash_table): Avoid double-initialization of the free list. Reallocate H->next last, in case other reallocations exhaust memory. * src/lisp.h (struct Lisp_Hash_Table): ‘next_free’ is now ptrdiff_t, not Lisp_Object. Adjust commentary for ‘next’ and ‘index’, which no longer contain nil. (HASH_NEXT, HASH_INDEX): Move to src/fns.c.
* | Hash table threshold is now float, not doublePaul Eggert2017-02-212-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change default from 0.8 to 0.8125 so it fits in float without rounding glitches. * doc/lispref/hash.texi (Creating Hash): * doc/lispref/objects.texi (Hash Table Type): * etc/NEWS: Document change. * src/fns.c (make_hash_table, maybe_resize_hash_table) (Fmake_hash_table): Threshold is now float, not double. Be consistent about how this is rounded. * src/lisp.h (struct Lisp_Hash_Table.rehash_threshold): Change back to float, now that the other code rounds consistently. (DEFAULT_REHASH_THRESHOLD): Now float 0.8125 instead of double 0.8.
* | Verify xwidget USE_LSB_TAG assumptionPaul Eggert2017-02-201-0/+2
| | | | | | | | | | * src/xwidget.c (Fxwidget_webkit_execute_script): Add verification. Problem reported by Andreas Schwab (Bug#25816#8).
* | * src/insdel.c (make_gap): Improve comment.Stefan Monnier2017-02-201-1/+3
| |
* | Port xwidget to -DCHECK_LISP_OBJECT_TYPEPaul Eggert2017-02-201-5/+12
| | | | | | | | | | | | | | * src/xwidget.c (webkit_javascript_finished_cb) (Fxwidget_webkit_execute_script): Don't assume Lisp_Object is an integer. This fix is just a hack; I’ll file a bug report about the underlying problem.
* | ; * src/insdel.c: State file encoding explicitly.Eli Zaretskii2017-02-201-1/+1
| |
* | Fix glitches in recent hash table changesPaul Eggert2017-02-192-8/+7
| | | | | | | | | | | | | | | | | | | | | | * src/fns.c (Fmake_hash_table): Simplify the machine code slightly by using 0 rather than -1. * src/lisp.h (struct Lisp_Hash_Table.pure): Now bool rather than a bitfield, for speed (the bitfield did not save space). (struct Lisp_Hash_Table.rehash_threshold): Now double rather than float, since the float caused unwanted rounding errors, e.g., (hash-table-rehash-threshold (make-hash-table)) yielded 0.800000011920929 instead of the correct 0.8.
* | * src/insdel.c (make_gap): Increase enough to avoid O(N^2) behavior.Stefan Monnier2017-02-191-1/+14
| |
* | ; Minor fix of recent change in fringe.cEli Zaretskii2017-02-191-2/+2
| | | | | | | | | | * src/fringe.c (init_fringe_bitmap) [HAVE_NTGUI]: Remove an unnecessary #ifdef introduced in a recent change.
* | ; * src/fns.c (Fmake_hash_table): Prefer 'double' to 'float'.Eli Zaretskii2017-02-191-1/+1
| |
* | Avoid aborts during loadupEli Zaretskii2017-02-194-6/+6
| | | | | | | | | | | | | | | | * src/emacs-module.c (syms_of_module): * src/image.c (xpm_make_color_table_h): Update calls to make_hash_table to adjust to a recent change in fns.c. * src/fns.c (make_hash_table): * src/lisp.h (make_hash_table): 4th arg is now of type double.
* | Fix fringe bitmap initialization on MS-WindowsYAMAMOTO Mitsuharu2017-02-191-0/+13
| | | | | | | | | | * src/fringe.c (init_fringe_bitmap) [HAVE_NTGUI]: Fix initialization of fb->bits. (Bug#25673)
* | Change type of `rehash_threshold' and `pure' fields in hash-tablesStefan Monnier2017-02-187-42/+42
| | | | | | | | | | | | | | | | | | | | | | | | * src/lisp.h (struct Lisp_Hash_Table): Change type of `rehash_threshold' and `pure' fields and move them after `count'. * src/fns.c (make_hash_table): Change type of `rehash_threshold' and `pure'. (Fmake_hash_table, Fhash_table_rehash_threshold): * src/category.c (hash_get_category_set): * src/xterm.c (syms_of_xterm): * src/profiler.c (make_log): * src/print.c (print_object): * src/alloc.c (purecopy_hash_table, purecopy): Adjust accordingly.
* | Use 'char *FOO' instead of 'char* FOO'Paul Eggert2017-02-1821-57/+60
| |
* | Support 24-bit direct colors on text terminalsRami Ylimäki2017-02-182-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/term.c (init_tty): Use 24-bit terminal colors if corresponding foreground and background functions are present in terminal type definition. * src/tparam.h: Define prototype for tigetstr. * lisp/term/tty-colors.el (tty-color-define): Convert color palette index to pixel value on 16.7M color terminals. (tty-color-24bit): New function to convert color palette index to pixel value on 16.7M color terminals. (tty-color-desc): Don't approximate colors on 16.7M color terminals. * lisp/term/xterm.el (xterm-register-default-colors): Define all named TTY colors on 16.7M color terminals. * doc/misc/efaq.texi (Colors on a TTY): Add instructions on how to enable direct color TTY mode. * etc/NEWS: Mention direct color TTY mode and point to FAQ.
* | Remove unused TN_max_pairs fieldRami Ylimäki2017-02-182-10/+0
| | | | | | | | | | | | | | * src/termchar.h (tty_display_info): Remove TN_max_pairs field, describing maximum number of terminal background/foreground color pairs. * src/term.c (tty_default_color_capabilities, tty_setup_colors) (init_tty): Remove references to TN_max_pairs.
* | Improve commentary for a recent change in keyboard.cEli Zaretskii2017-02-181-1/+1
| | | | | | | | | | * src/keyboard.c (Fset__this_command_keys): Add a comment about the magic 248 value. (Bug#25612)
* | Remove annoying warnings about let-bindingEli Zaretskii2017-02-181-19/+0
| | | | | | | | | | | | * src/data.c (Fmake_variable_buffer_local, Fmake_local_variable): Remove warnings about making symbols local while let-bound. (Bug#25561)
* | Remove the build number from emacs-version variableGlenn Morris2017-02-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a largely internal detail that can confuse users. (Bug#25590) * lisp/version.el (emacs-build-number): New constant. (emacs-version): Use emacs-build-number. * lisp/loadup.el (top-level): When dumping, increment emacs-build-number rather than emacs-version. * src/emacs.c (emacs-version): Doc fix. * doc/lispref/intro.texi (Version Info): Update emacs-version details. Mention emacs-build-number. * lisp/gnus/gnus-util.el (gnus-emacs-version): * lisp/mail/emacsbug.el (report-emacs-bug): * admin/admin.el (set-version): Update for emacs-version change. ; * etc/NEWS: Mention this.
* | Explicit error on changing case of negative integersGlenn Morris2017-02-161-1/+1
| | | | | | | | | | * src/casefiddle.c (casify_object): Reject negative integers: Emacs characters are positive integers. (Bug#25684)
* | ; Spelling, punctuation and minor wording fixesPaul Eggert2017-02-162-2/+2
| |
* | * src/buffer.h: Fix indenting.Paul Eggert2017-02-161-1/+2
| |
* | Add sanity checks for Bswitch hash tablesPaul Eggert2017-02-161-12/+17
| | | | | | | | | | * src/bytecode.c (exec_byte_code) [BYTE_CODE_SAFE]: Check that operand is a hash table and hashes to ints.
* | * src/keyboard.c (read_key_sequence): Fix integer-overflow glitch.Paul Eggert2017-02-161-8/+8
| |
* | casing: don’t assume letters are *either* upper- or lower-case (bug#24603)Michal Nazarewicz2017-02-153-32/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A compatibility digraph characters, such as Dž, are neither upper- nor lower-case. At the moment however, those are reported as upper-case¹ despite the fact that they change when upper-cased. Stop checking if a character is upper-case before trying to up-case it so that title-case characters are handled correctly. This fixes one of the issues mentioned in bug#24603. ¹ Because they change when converted to lower-case. Notice an asymmetry in that for a character to be considered lower-case it must not be upper-case (plus the usual condition of changing when upper-cased). * src/buffer.h (upcase1): Delete. (upcase): Change to upcase character unconditionally just like downcase does it. This is what upcase1 was. * src/casefiddle.c (casify_object, casify_region): Use upcase instead of upcase1 and don’t check !uppercasep(x) before calling upcase. * src/keyboard.c (read_key_sequence): Don’t check if uppercase(x), just downcase(x) and see if it changed. * test/src/casefiddle-tests.el (casefiddle-tests--characters, casefiddle-tests-casing): Update test cases which are now passing.
* | src/bytecode.c (exec_byte_code): Make hash_code a Lisp_Object.Vibhav Pant2017-02-111-2/+4
| | | | | | | | | | This avoids using XUINT every time while comparing it with HASH_HASH (h, i), replacing it with EQ.
* | src/bytecode.c (exec_byte_code): Remove unnecessary (e)assert.Vibhav Pant2017-02-111-4/+2
| |
* | ; src/bytecode.c (exec_byte_code): Refactor byte-switch code.Vibhav Pant2017-02-111-21/+14
| | | | | | | | Remove unnecessary asserts, remove duplicate code.
* | src/bytecode.c: Add optional sanity check for jump tables.Vibhav Pant2017-02-111-3/+4
| | | | | | | | | | * src/bytecode.c (exec_byte_code): When sanity checks are enabled, check that the jump table's size is equal to it's count.
* | Merge branch 'master' into feature/byte-switchVibhav Pant2017-02-1110-269/+272
|\ \
| * | Fix handling of XBM images on MS-WindowsEli Zaretskii2017-02-111-2/+2
| | | | | | | | | | | | | | | * src/image.c (xbm_load) [HAVE_NTGUI]: Fix calculation of 'nbytes' when inverting XBM data bits. (Bug#25661)
| * | Fix handling of PBM dataEli Zaretskii2017-02-111-1/+11
| | | | | | | | | | | | | | | * src/image.c (pbm_load): Handle PBM data with no blanks between individual pixel values correctly. (Bug#25660)
| * | Fix warnings in debug tracing codeNoam Postavsky2017-02-102-6/+6
| | | | | | | | | | | | | | | | | | * src/xdisp.c (dump_glyph, dump_glyph_string): * src/xfaces.c (dump_realized_face): Cast arguments or adjust format specifiers to match signedness.
| * | Fix a few integer-overflow glitchesPaul Eggert2017-02-104-55/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/composite.c (composition_compute_stop_pos, composition_reseat_it): * src/dispextern.h (struct composition_it.rule_idx): * src/keyboard.c (Fset__this_command_keys): * src/xwidget.c (webkit_js_to_lisp): Don’t assume object sizes fit in ‘int’. * src/xwidget.c (Fxwidget_resize): Don’t assume Emacs integers fit in ‘int’.
| * | Fix a bug with displaying an image after a TABEli Zaretskii2017-02-101-1/+4
| | | | | | | | | | | | | | | * src/xdisp.c (display_line): Handle TAB at end of screen line specially only when we are displaying characters. (Bug#25662)
| * | Restore special setting of this-command-keys by M-xEli Zaretskii2017-02-101-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was lost when execute-extended-command was reimplemented in Lisp. * src/keyboard.c (Fset__this_command_keys): New function. (syms_of_keyboard): Defsubr it. * lisp/simple.el (execute-extended-command): Set this-command-keys as novice.el expects. (Bug#25612)
| * | Make FOR_EACH_TAIL more like other FOR_EACH macrosPaul Eggert2017-02-063-111/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See comments by Stefan Monnier in: http://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00181.html and by Eli Zaretskii in: http://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00207.html * src/fns.c (internal_equal): Do not bypass check for depth overflow when tail-recursing via a dotted list tail or an overlay plist, to avoid a rare infloop. * src/lisp.h (FOR_EACH_TAIL, FOR_EACH_TAIL_SAFE): Take TAIL as an arg, and update it at each iteration, rather than have callers access it.tail. All callers changed. (FOR_EACH_TAIL): Do not check for dotted lists, as this is now the caller’s responsibility. All callers changed. (FOR_EACH_TAIL_CONS): Remove. All callers changed. (struct for_each_tail_internal.tail): Remove; no longer needed. (FOR_EACH_TAIL_INTERNAL): Remove dotted arg, and set the tail arg each time through the loop. All callers changed.
| * | Port to clang 3.8.0Paul Eggert2017-02-051-3/+9
| | | | | | | | | | | | | | | | | | It does not allow a for-loop's control var to be an anonymous struct. * src/lisp.h (struct for_each_tail_internal): New type. (FOR_EACH_TAIL_INTERNAL): Use it.
| * | FOR_EACH_TAIL now checks for quitPaul Eggert2017-02-051-20/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | As per Eli Zaretskii (Bug#25606#20). Although these calls to maybe_quit are unnecessary in practice, Eli was not convinced that the calls are unnecessary. * src/lisp.h (FOR_EACH_TAIL, FOR_EACH_TAIL_CONS): Call maybe_quit every so often. (FOR_EACH_TAIL_INTERNAL): New arg CHECK_QUIT. All callers changed.
| * | Signal list cycles in ‘length’ etc.Paul Eggert2017-02-053-216/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use macros like FOR_EACH_TAIL instead of maybe_quit to catch list cycles automatically instead of relying on the user becoming impatient and typing C-g (Bug#25606). * src/fns.c (Flength, Fmember, Fmemq, Fmemql, Fassq, Fassoc, Frassq) (Frassoc, Fdelete, Freverse): Use FOR_EACH_TAIL instead of maybe_quit. (Fnreverse): Use simple EQ to check for circular list instead of rarely_quit, as this suffices in this unusual case. (Fplist_put, Flax_plist_put, Flax_plist_put): Use FOR_EACH_TAIL_CONS instead of maybe_quit. (internal_equal): Use FOR_EACH_TAIL_CONS to check lists, instead of by-hand tail recursion that did not catch cycles. * src/fns.c (Fsafe_length, Fplist_get): * src/xdisp.c (display_mode_element): Use FOR_EACH_TAIL_SAFE instead of by-hand Floyd’s algorithm. * src/lisp.h (QUIT_COUNT_HEURISTIC): Remove; no longer needed. (rarely_quit): Simply count toward USHRT_MAX + 1, since the fancier versions are no longer needed. (FOR_EACH_TAIL_CONS, FOR_EACH_TAIL_SAFE) (FOR_EACH_TAIL_INTERNAL): New macros, the last with definiens mostly taken from FOR_EACH_TAIL. (FOR_EACH_TAIL): Rewrite in terms of FOR_EACH_TAIL_INTERNAL.
| * | Simplify use of FOR_EACH_TAILPaul Eggert2017-02-053-23/+33
| | | | | | | | | | | | | | | | | | | | | | | | * src/data.c (circular_list): New function. * src/lisp.h (FOR_EACH_TAIL): Use Brent’s algorithm and C99 for-loop decl, to eliminate the need for the args TAIL, TORTOISE and N, and to speed things up a bit on typical hosts with optimization. All uses changed (Bug#25605).
* | | * src/bytecode.c: Refactor to follow GNU coding standardsVibhav Pant2017-02-111-14/+10
| | |
* | | src/bytecode.c: Avoid comparing values unnecessarily in BswitchVibhav Pant2017-02-101-2/+4
| | | | | | | | | | | | | | | | | | * src/bytecode.c: (exec_byte_code) While linear searching the jump table, compare the value's hash table first to avoid calling h->test.cmpfn every time.
* | | src/bytecode.c (exec_byte_code): Remove unneeded assert.Vibhav Pant2017-02-091-6/+4
| | |
* | | bytecode.c (exec_byte_code): Use h->count instead of HASH_TABLE_SIZEVibhav Pant2017-02-091-2/+9
| | |
* | | bytecode.c (exec_byte_code): don't check hash code in linear search.Vibhav Pant2017-02-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | * src/bytecode.c (exec_byte_code): Don't check that the hash code is not nil when linear scanning the jump table. Hash tables for are declared with :size as the exact number of cases, so each entry i should have a hash code. When BYTE_CODE_SAFE, do it as a sanity check.
* | | Improve byte-switch execution.Vibhav Pant2017-02-091-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el, lisp/emacs-lisp/bytecomp.el (byte-decompile-bytecode-1), (byte-compile-lapcode): Calculate the actual jump address while compiling, store it in the jump table. * src/bytecode.c: Jump to the looked up value directly, do a linear search when the number of elements is <= 5.
* | | Merge remote-tracking branch 'origin/master' into feature/byte-switchVibhav Pant2017-02-0525-674/+510
|\ \ \ | |/ /
| * | Re-port alloc.c to Solaris sparc and simplifyPaul Eggert2017-02-021-120/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alloc.c had bitrotted a bit, and used an undefined symbol stack_base when Emacs was built on Solaris sparc, leading to compilation failures. Also, code related to __builtin_unwind_init was unnecessarily duplicated. Fix the bitrot and remove some duplication. * src/alloc.c: Remove uses of GC_SAVE_REGISTERS_ON_STACK, since it is never defined. (test_setjmp) [!HAVE___BUILTIN_UNWIND_INIT && GC_SETJMP_WORKS]: Define a no-op dummy, to simplify use. (test_setjmp) [!GC_SETJMP_WORKS]: Test setjmp_tested_p here rather than in the caller, to simplify use. (stacktop_sentry): New type. (__builtin_unwind_init) [!HAVE___BUILTIN_UNWIND_INIT]: New macro. (SET_STACK_TOP_ADDRESS): New macro, containing code that was duplicated. (flush_stack_call_func, Fgarbage_collect): Use it. (init_alloc): Omit unnecessary initialization. After dumping, Emacs need not re-test setjmp.