TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Understanding go compiler tools (2)

36 点作者 freedrull超过 14 年前

3 条评论

barrkel超过 14 年前
Letting the OS free memory at process exit is a very viable approach for single-purpose tools that don't run a reasonable risk of running out of memory. (Structs over unions are also more debuggable and less prone to bugs.)<p>On the other hand, if you ever want to turn what you wrote into a library instead of a standalone process, not having taken more care over memory management will hurt.<p>For compilers, there's often a happy medium available: pool / arena-based allocation, with one pool per translation unit.
chc超过 14 年前
For anyone who isn't familiar: Yugui is part of the Ruby Core team, so she knows a bit about language implementation.
pbiggar超过 14 年前
I read an estimate that about 40% of programmer time spent writing a C or C++ program goes into memory management. Compilers often don't really need sophisticated memory management techniques, as they don't run for very long. Go in particular seems designed to never compile really large compilation units (like you might in C++).<p>tl;dr if I was writing a Go compiler, I wouldn't worry about memory management either.
评论 #2241721 未加载