]> git.eshelyaron.com Git - emacs.git/commit
Let the OS clear new large strings of NUL
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 4 Jan 2020 01:14:00 +0000 (17:14 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 4 Jan 2020 01:15:44 +0000 (17:15 -0800)
commitcadf985cb68a760ef342d61572620cb215cf86fb
treee27b62837d480907fff649ad5bc23047ec1be6d6
parent98ab70bc5185e8d767a9076f4f9796c1fa1a9262
Let the OS clear new large strings of NUL

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.
src/alloc.c
src/data.c
src/lisp.h