aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Add facility to make module functions interactive (Bug#23486).Philipp Stephani2020-09-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/module-env-28.h: Add field for 'make_interactive' function. * src/emacs-module.c (Lisp_Module_Function): Add new field holding the interactive form. (allocate_module_function): Adapt to structure layout change. (module_make_interactive, module_function_interactive_form): New functions. (initialize_environment): Use them. * src/eval.c (Fcommandp): * src/data.c (Finteractive_form): Also handle interactive module functions. * test/data/emacs-module/mod-test.c (Fmod_test_identity): New test function. (emacs_module_init): Create two interactive module test functions. * test/src/emacs-module-tests.el (module/interactive/return-t) (module/interactive/return-t-int, module/interactive/identity): New unit tests. * doc/lispref/internals.texi (Module Functions): Document new function. Rework paragraph about wrapping module functions, as the example no longer applies. * etc/NEWS: Document new facility.
* | | * src/data.c (subr-native-lambda-list): Defined it unconditionally (bug#43255)Andrea Corallo2020-09-061-2/+2
| | |
* | | Rework native compiled lisp/d lambda list accessorAndrea Corallo2020-09-011-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/help.el (help-function-arglist): Logic update for new 'Fsubr_native_lambda_list'. * src/data.c (Fsubr_native_dyn_p): Remove. (Fsubr_native_lambda_list): Return t when the input is not a compiled lisp/d subr. (syms_of_data): Update for 'Fsubr_native_dyn_p' removal.
* | | Fix describe function arglist for native compiled lisp/d (bug#42572)Andrea Corallo2020-08-311-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/help.el (help-function-arglist): Handle the case of native compiled lisp/d. * src/data.c (syms_of_data): Register new subrs. (Fsubr_native_dyn_p, Fsubr_native_lambda_list): New primitives. * test/src/comp-tests.el (comp-tests-dynamic-help-arglist): New test.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-08-091-6/+0
|\ \ \ | |/ /
| * | Simplify use of __lsan_ignore_objectPaul Eggert2020-08-031-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Use AC_CHECK_FUNCS_ONCE for __lsan_ignore_object. * src/buffer.c, src/data.c, src/emacs-module.c, src/regex-emacs.c: * src/search.c: Use __lsan_ignore_object unconditionally, and don’t include sanitizer/lsan_interface.h. * src/lisp.h (__lsan_ignore_object): Provide a dummy in the typical case where leak sanitization is not available.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-08-021-0/+7
|\ \ \ | |/ /
| * | Use a more precise check for '__lsan_ignore_object'Philipp Stephani2020-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Add check for __lsan_ignore_object. * src/buffer.c (enlarge_buffer_text): * src/data.c (make_blv): * src/emacs-module.c (Fmodule_load, initialize_environment): * src/regex-emacs.c (regex_compile): * src/search.c (newline_cache_on_off): Use new configuration macro.
| * | Suppress leak detector in some casesPhilipp Stephani2020-08-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We intentionally leak some objects. Prevent the ASan leak detector from raising false alarms in these cases. * configure.ac: Search for lsan_interface.h header. * src/data.c (make_blv): Allow leaking of buffer-local values. * src/buffer.c (enlarge_buffer_text): Allow leaking of buffer text. * src/emacs-module.c (Fmodule_load, initialize_environment): Allow intentional leak of runtime and environment objects if module assertions are enabled.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-05-061-4/+16
|\ \ \ | |/ /
| * | Merge from origin/emacs-27Glenn Morris2020-05-061-4/+16
| |\ \ | | |/ | | | | | | f9fa726ced Improve doc strings of makunbound and fmakunbound
| | * Improve doc strings of makunbound and fmakunboundStefan Kangas2020-05-031-4/+16
| | | | | | | | | | | | | | | * src/data.c (Fmakunbound, Ffmakunbound): Improve doc strings. (Bug#41026)
* | | * src/data.c (syms_of_data): Fix #ifdef HAVE_NATIVE_COMP position.Andrea Corallo2020-04-251-1/+1
| | |
* | | * src/comp.c (native-comp-unit-set-file): New function.Andrea Corallo2020-04-121-0/+11
| | |
* | | * src/comp.c (native-comp-unit-file): Better parameter name.Andrea Corallo2020-04-121-3/+4
| | |
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-03-291-36/+41
|\ \ \ | |/ /
| * | Refactor and fix typo in CHECK_*_COERCE_MARKERPaul Eggert2020-03-261-36/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/data.c (check_integer_coerce_marker) (check_number_coerce_marker): New functions. Also, fix a typo in the former, by having it use Qinteger_or_marker_p not Qnumber_or_marker_p. (arithcompare, floatop_arith_driver, bignum_arith_driver) (arith_driver, Fplus, Fminus, Ftimes, Fquo, Frem, Fmod) (minmax_driver, Flogand, Flogior, Flogxor, Fadd1, Fsub1): Use them in place of the similarly-named macros. * src/lisp.h (CHECK_NUMBER_COERCE_MARKER) (CHECK_INTEGER_COERCE_MARKER): Remove; no longer used.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-03-231-1/+1
|\ \ \ | |/ /
| * | Merge from origin/emacs-27Glenn Morris2020-03-231-1/+1
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d66331aea4 (origin/emacs-27) Don't build the Gnulib 'utimens' module ... f2351a689b Add Harfbuzz dependency 8944310d7c Don't signal during backtrace unrewind (Bug#40088) 8709aaddd8 Fix a couple of problems in changelog generating functions 9ab85f087f Fix cl-concatenate (Bug#40180) 561e9fb91b Improve documentation of project.el commands b28a9a6cc3 Make svg images with links valid 7515252cce * lisp/tab-line.el (tab-line-new-button-show): New defcustom. # Conflicts: # etc/NEWS # nt/gnulib-cfg.mk
| | * Don't signal during backtrace unrewind (Bug#40088)Noam Postavsky2020-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | backtrace_eval_unrewind is used to temporarily reverse let-bindings (it's called with a positive argument to reverse bindings, and then a negative argument to re-apply them) by backtrace--locals and backtrace-eval. For the SPECPDL_LET_DEFAULT and SPECPDL_LET_LOCAL cases (which occur for let-bindings on buffer-local variables), the code calls Fdefault_value and Fbuffer_local_value on the symbol. For symbols which are unbound at top-level, the first (with positive argument) call to backtrace_eval_unrewind will set the symbol's value to unbound (putting the current value in the specpdl's "old value" slot). On the second (with negative argument) call, backtrace_eval_unrewind attempts to retrieve the symbol's value with Fdefault_value or Fbuffer_local_value, but that raises a void-variable signal. This interrupts the restoration of the let-bindings, so any other variables more recent on the stack will now have the wrong value. * src/data.c (default_value): Make non-static. * src/lisp.h: Declare it. * src/eval.c (backtrace_eval_unrewind): Replace the calls to Fdefault_value and Fbuffer_local_value with default_value and buffer_local_value, respectively. The latter do exactly the same as the former, except if the symbol's value is Qunbound they just return it instead of signaling void-variable.
* | | Trigger native compilation when loading bytecodeAndrea Corallo2020-03-161-0/+2
| | | | | | | | | | | | | | | Introduce a first mechanism to trigger compilation when lex elc files are loaded. This is off by default and has to be better tested.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-02-231-8/+2
|\ \ \ | |/ /
| * | Restore runtime check for invalid tagPaul Eggert2020-02-221-8/+2
| | | | | | | | | | | | | | | | | | * src/data.c (wrong_type_argument): Restore check that the object’s tag is valid, since invalid tags exist again. * src/lisp.h (Lisp_Type_Unused0): New constant.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-02-041-41/+25
|\ \ \ | |/ /
| * | Make Faset nonrecursivePaul Eggert2020-01-181-28/+28
| | | | | | | | | | | | | | | * src/data.c (Faset): Refactor Faset so that it’s not recursive. This helps the compiler and makes the code a bit clearer.
| * | Improve performance when a string's byte count changesPaul Eggert2020-01-181-26/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c (allocate_string_data): Now static. Remove code for when Faset calls this function when S already has data assigned, as that can no longer happen. (resize_string_data): New function, which avoids relocation in more cases than the old code did, by not bothering to relocate when the size changes falls within the alignment slop. * src/data.c (Faset): Use resize_string_data. Change a while to a do-while since it must iterate at least once.
| * | Let the OS clear new large strings of NULPaul Eggert2020-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On my platform, this sped up (make-string 4000000000 0) from 2.5 to 0.015 seconds (not that people should want to do this much :-). * src/alloc.c (allocate_string_data): New arg CLEARIT. Callers changed. (Fmake_string): Prefer calloc to malloc+memset when allocating a large string of NUL bytes. (make_clear_string): New function. (make_uninit_string): Use it. (make_clear_multibyte_string): New function. (make_uninit_multibyte_string): Use it.
* | | Always define subr-native-elisp-p also without native compilerAndrea Corallo2020-02-031-1/+1
| | |
* | | some rework to please --enable-check-lisp-object-typeAndrea Corallo2020-01-011-1/+1
| | |
* | | fix naming for predicate SUBR_NATIVE_COMPILEDPAndrea Corallo2020-01-011-2/+2
| | |
* | | mitigate ifdef proliferationAndrea Corallo2020-01-011-3/+2
| | |
* | | add native-comp-unit-file primitiveAndrea Corallo2020-01-011-1/+11
| | |
* | | add subr-native-compilation-unit primitiveAndrea Corallo2020-01-011-2/+12
| | |
* | | add support for native comp unit to type-ofAndrea Corallo2020-01-011-0/+3
| | |
* | | introduce SUBRP_NATIVE_COMPILEDPAndrea Corallo2020-01-011-2/+2
| | |
* | | add basic compilation unit into structureAndrea Corallo2020-01-011-2/+2
| | |
* | | native compile interactive functions supportAndrea Corallo2020-01-011-0/+4
| | |
* | | improve subr-native-elisp-pAndrea Corallo2020-01-011-4/+3
| | |
* | | fix subr-native-elisp-p predicate nameAndrea Corallo2020-01-011-2/+2
| | |
* | | add native_elisp field into Lisp_SubrAndrea Corallo2020-01-011-0/+14
|/ /
* | Assume C99-style ‘long long’Paul Eggert2019-12-311-24/+9
|/ | | | | | | | | | | | | Now that Gnulib assumes ‘long long’, it is a good time to clean out old cruft porting to pre-C99 compilers that lack it. * src/data.c (ULL_WIDTH, ULL_MAX): Remove. All uses replaced by ULLONG_WIDTH, ULLONG_MAX. (bits_word_to_host_endian): Assume ‘unsigned long long’. By the way, the old code had a performance typo: it used HAVE_UNSIGNED_LONG_LONG where it should have used HAVE_UNSIGNED_LONG_LONG_INT. * src/sysdep.c (ULLONG_MAX): Remove, as lib/limits.h does this now. (time_from_jiffies) [GNU_LINUX]: Assume ‘long long’.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Improve documentation of 'add-variable-watcher'Eli Zaretskii2019-11-151-2/+3
| | | | | | | | * doc/lispref/variables.texi (Watching Variables): Clarify the documentation of 'add-variable-watcher' and fix markup. * src/data.c (Fadd_variable_watcher): Clarify the doc string. (Bug#38205)
* Refactor bignum multiplication, exponentiationPaul Eggert2019-11-131-74/+0
| | | | | | | This doesn’t alter behavior, and simplifies the next commit. * src/bignum.c (GMP_NLIMBS_MAX, NLIMBS_LIMIT, emacs_mpz_size) (emacs_mpz_mul, emacs_mpz_mul_2exp, emacs_mpz_pow_ui): Move here ... * src/data.c: ... from here.
* Simplify fixnum division slightlyPaul Eggert2019-11-061-4/+6
| | | | | | * src/data.c (arith_driver): Streamline fixnum division a bit more, and add a comment about why overflow is impossible. This responds to a private comment by Stefan Monnier.
* Remove unneeded overflow check in integer divisionPaul Eggert2019-11-051-4/+3
| | | | | | | * src/data.c (arith_driver): Remove unnecessary runtime test, since integer overflow is impossible on division of fixnums, given that the worst case is MOST_NEGATIVE_FIXNUM / -1 which is representable as an EMACS_INT (albeit not as a fixnum).
* Overflow errors are range errorsPaul Eggert2019-11-041-2/+2
| | | | | | | | | | | * etc/NEWS: Mention this. * doc/lispref/errors.texi (Standard Errors): Document overflow-error, which was formerly undocumented. It is a range error, not a domain error. * src/data.c (syms_of_data): overflow-error and (undocumented) underflow-error are subtypes range-error, not domain-error. This fixes bugs in timezone-time-from-absolute and in erc-ctcp-reply-PING.
* Don’t signal overflow for (expt 1 bignum)Paul Eggert2019-11-041-6/+21
| | | | | | | | Similarly for (expt 0 bignum) and (expt -1 bignum). The result is always a -1, 0 or 1, so do not signal overflow. * src/data.c (expt_integer): Do not signal an overflow if -1 <= X <= 1. Be clearer about when overflow is signaled. * test/src/floatfns-tests.el (bignum-expt): Test this.
* Speed up % and mod with fixnum denomPaul Eggert2019-08-241-48/+52
| | | | | | | * src/data.c (integer_remainder): New function. When the numerator is a bignum and the denominator is small, this function uses mpz_tdiv_ui, which should be faster than mpz_tdiv_r. (Frem, Fmod): Use it.
* Tweak integer mod performancePaul Eggert2019-08-241-1/+1
| | | | | | * src/data.c (integer_mod): Use mpz_tdiv_r not mpz_mod, as that’s more similar to the fixnum case, is a bit more efficient, and otherwise the later ‘sgn_r < 0’ code is useless anyway.