Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于 Golang 内存分配机制 的延伸问题 #71

Open
panhongrainbow opened this issue Apr 10, 2024 · 0 comments
Open

关于 Golang 内存分配机制 的延伸问题 #71

panhongrainbow opened this issue Apr 10, 2024 · 0 comments

Comments

@panhongrainbow
Copy link

问题描述

Golang 的内存分配机制有两大策略
顺序分配 (sequential allocation) 和
自由表分配 (free-list allocation)

其中,顺序分配比较迎合 Go Routine 的执行栈,因为一次可以分配整块内存空间

但是问题来了,Go Routine 的执行栈要扩容,如果用 自由表分配 扩容时,就不需要重新复制整个 Go Routine 的执行栈
所以 Golang 应是以 自由表分配 为主比较合理?

我的观点正确吗?谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant