Skip to content
Opensource internals
  • Posts

Runtime

How Go's reflect Package Reads Types: The rtype and the Method Table

Oct 21, 2026 13 min read Jay Hubbert

reflect reads the runtime’s own abi.Type descriptors; a reflect.Value is a (typ, ptr, flag) triple whose flag word encodes kind, indirection, addressability and read-only state in …

GoInternalsReflectionRuntimePerformance

Read more →

range over func: The Compiler Turns a Loop Into a Coroutine

Oct 21, 2026 20 min read Jay Hubbert

The compiler rewrites a range-over-func loop into a yield callback, tracks iterator misbehaviour with a state machine, and hands coroutine switching to iter.Pull.

GoInternalsIteratorsCompilerRuntime

Read more →

runtime.AddCleanup: How Go Replaced Finalizers With a Queue of Specials

Oct 21, 2026 19 min read Jay Hubbert

runtime.AddCleanup replaces SetFinalizer with span specials, a lock-free block queue and a pool of cleanup goroutines, so cleanups run promptly and in parallel instead of one at a …

GoInternalsGarbage collectionFinalizersRuntime

Read more →

Weak Pointers in Go: The Runtime's Special Span for Non-Tracked Objects

Oct 21, 2026 16 min read Jay Hubbert

weak.Pointer is backed by a per-object special record holding a uintptr handle, which the GC scans as a root but never treats as a strong reference, so the target can still be …

GoInternalsGarbage collectionWeak pointersRuntime

Read more →

Why Go Randomizes Map Iteration: The Attack It Prevents

Oct 21, 2026 14 min read Jay Hubbert

Map iteration picks two random offsets at start-up - one in the table directory, one in the slot space - and every map gets a random hash seed, which together defeat hash-flooding …

GoInternalsRuntimeMapsSecurity

Read more →

← Newer Page 2 of 2 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·