Re: Does newByteArray clear?

Bertram Felgenhauer via Glasgow-haskell-users <[email protected]>
Newsgroups gmane.comp.lang.haskell.glasgow.user
Message-ID <20200827005629.GA24966@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f>
David Feuer wrote:
> I'm looking to play around with an array-based structure with
> sub-linear worst-case bounds. Array is pretty awkward in that context
> because creating a new one takes O(n) time to initialize it. Is that
> all true of newByteArray, or can I get one with arbitrary garbage in it
> for cheap?

newByteArray# does not actively clear memory.

However, for large arrays, I think the memory is likely to be freshly
allocated from the OS, and the OS will have cleared it for security
reasons.

Cheers,

Bertram
_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.