On 17/11/09 22:13, Bram Moolenaar wrote:
> Dominique Pelle wrote:
[...]
>> I assumed that variables in .bss (search_hl in this case) are always
>> initialized to 0. Out of curiousity, on which version of Vim that is not
>> the case?
>>
>> =========================================
>> $ man elf
>> ...
>> Various sections hold program and control information:
>>
>> .bss This section holds uninitialized data that contributes to the
>> program’s memory image. By definition, the system initial‐
>> izes the data with zeros when the program begins to run.
>> This section is of type SHT_NOBITS. The attribute types are
>> SHF_ALLOC and SHF_WRITE.
>> ...
>> =========================================
>
> On modern systems this should happen. But there are a few systems where
> this does not happen.
[...]
The above is for elf binaries as used on Linux. But ISTR (somewhat
hazily, it was years and years ago, and on Dos, so don't take my word
for it) that the BSS segment (the heap IIRC) is usually left
uninitialized (i.e. whatever was there before loading the program; maybe
part of the compressed image in self-uncompressing binaries). That would
be in .EXE executables.
Best regards,
Tony.
--
Scott's second Law:
When an error has been detected and corrected, it will be found
to have been wrong in the first place.
Corollary:
After the correction has been found in error, it will be
impossible to fit the original quantity back into the equation.
--
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php