Commit cadf985c authored by Paul Eggert's avatar Paul Eggert

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.
parent 98ab70bc
Pipeline #4476 failed with stage
in 54 minutes and 38 seconds