aclements
Re:The Green Tea Garbage Collector
on Friday October 31, 2025 @11:37AM (#45773273)
Thanks for this question! We added a couple sentences to the blog post to explain what a page is. In general, a page is a region of memory that has a large-ish fixed power-of-two size and is also aligned to its size. Virtual memory structures memory around pages, which are typically 4 KiB to 64 KiB depending on the hardware. The Go memory manager, and many other memory managers, also structure memory around pages, which may or may not match the hardware page size. In Go, pages are always 8 KiB and aligned to 8 KiB.
Re:The Green Tea Garbage Collector
on Friday October 31, 2025 @11:33AM (#45773221)
I'm a long-time fan of matcha and wrote the initial prototype that demonstrated Green Tea was viable while cafe crawling in Yokohama and drinking lots of matcha. "Matcha" didn't seem like a great name for a garbage collector, but matcha is a form of green tea and "Green Tea GC" rolled off the tongue, so I called my prototype Green Tea and the name stuck.
Re:Mid-stack inlining in the Go compiler
on Monday March 06, 2017 @04:05PM (#13806038)
"So it records the calling convention, architecture flags, alignment, and other ABI pieces etc?"
No. At the moment it records the AST in the object file, because the inliner works at the Go AST level. In the future it may instead record the SSA representation (which would obviously give better cost estimates; the current heuristics are really extremely simple).
"FWIW: Writing out the info is usually not the hard part, actually, and is unrelated to the DAG-ness of the packages."
The DAG-ness means it's always available when compiling the call site, even if it's a cross-package call. It means you don't have to do it at link time.
Re:Mid-stack inlining in the Go compiler
on Monday March 06, 2017 @01:31PM (#13804853)
Go already performs cross-package inlining, so it can already inline library calls. (This is relatively easy to do in Go compared to other languages because packages must form a DAG. Compiling package A writes out enough information in the object file for A that compiling package B that depends on A can inline calls to functions in A.)
Re:Mid-stack inlining in the Go compiler
on Monday March 06, 2017 @01:28PM (#13804813)
We plan to expose all of the inlining information in the DWARF tables so debuggers won't have any problems with this. Internally, the runtime uses a different representation just so we can make it more compact and optimized for the runtime's exact needs. This way, you can also strip the debug info without breaking the runtime's own ability to walk stacks.