Skip to content

*Is stack allocated memory zero initiallized > #14972

Answered by vzarytovskii
Xyncgas asked this question in Q&A
Discussion options

You must be logged in to vote

It just emits localloc instruction, and here's what spec says:

The localloc instruction allocates size (type native unsigned int) bytes from the local dynamic memory pool and returns the address (a managed pointer, type &) of the first allocated byte. The block of memory returned is initialized to 0 only if the initialize flag on the method is true (see Partition I). The area of memory is newly allocated. When the current method returns the local memory pool is available for reuse.

So, in other words it depends whether method has localsinit.

F# doesn't skip locals init by default iirc.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Xyncgas
Comment options

Answer selected by Xyncgas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants