summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cursor-sensor.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2021-12-31 17:24:31 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2022-01-24 11:41:46 +0100
commit65caf5b205d22f76bb4ec85cfe597b621a83afb3 (patch)
tree8a4b71295d56f76ad0fee6c4471aa036c6e7e226 /lisp/emacs-lisp/cursor-sensor.el
parentce1de3a8d9723305f48fd4527fbceaff3cec50ba (diff)
downloademacs-65caf5b205d22f76bb4ec85cfe597b621a83afb3.tar.gz
emacs-65caf5b205d22f76bb4ec85cfe597b621a83afb3.tar.bz2
emacs-65caf5b205d22f76bb4ec85cfe597b621a83afb3.zip
Pin bytecode strings to avoid copy at call time
Avoid making a copy (in the interpreter C stack frame) of the bytecode string by making sure it won't be moved by the GC. This is done by reallocating it to the heap normally only used for large strings, which isn't compacted. This requires that we retain an explicit reference to the bytecode string object (`bytestr`) lest it be GCed away should all other references vanish during execution. We allocate an extra stack slot for that, as we already do for the constant vector object. * src/alloc.c (allocate_string_data): Add `immovable` argument. (resize_string_data, make_clear_multibyte_string): Use it. (pin_string): New. * src/pdumper.c (dump_string): Fix incorrect comment. Update hash for Lisp_String (only comments changed, not contents). * src/lread.c (read1): * src/alloc.c (Fmake_byte_code, purecopy): * src/bytecode.c (Fbyte_code): Pin bytecode on object creation. (exec_byte_code): Don't copy bytecode. Retain `bytestr` explicitly. * src/lisp.h (Lisp_String): Explain special size_byte values. (string_immovable_p): New.
Diffstat (limited to 'lisp/emacs-lisp/cursor-sensor.el')
0 files changed, 0 insertions, 0 deletions