Is it safe to read to memory after it has been allocated with `pureMalloc` and `pureRealloc`?

rempas rempas at tutanota.com
Mon Apr 4 10:35:23 UTC 2022


On Monday, 4 April 2022 at 09:26:13 UTC, Stanislav Blinov wrote:
> No. Neither `malloc` nor `realloc` (for which D's `pure...` 
> variants are mere wrappers) are specified to initialize 
> allocated memory. `calloc`, however, is - it initializes 
> allocated block with zeroes.

Thanks, that's what I was looking for! I'll switch to `calloc` 
instead. Have a great day!


More information about the Digitalmars-d-learn mailing list