How does Go handle heap allocation?

Written by
Link to Post

Does Go pre-allocates a chunk of memory and take from it for each allocation (like JVM), or it allocates every time a variable is created, and is it a kernel call (malloc)?

If it is one kernel call per allocation, that would make variable creation expensive. How can I force allocation on the stack/heap?

submitted by /u/texasbruce
[link] [comments]

Article Tags:
· ·
Article Categories:

Leave a Reply