Xiao Lou's Tech Notes
Xiao Lou's Tech Notes
Mar 13, 2025 · Fundamentals

Master Go’s New Cleanup Functions and Weak Pointers for Safer Memory Management

Go 1.24 introduces runtime.AddCleanup and weak.Pointer, advanced garbage‑collector tools that let developers attach cleanup callbacks without retaining objects and safely cache objects via weak references, offering more precise memory management, eliminating finalizer pitfalls, and enabling custom unique‑package implementations.

cleanup functionsruntime.AddCleanupweak references
0 likes · 9 min read
Master Go’s New Cleanup Functions and Weak Pointers for Safer Memory Management
21CTO
21CTO
Nov 30, 2019 · Backend Development

What’s New in PHP 7.4? Typed Properties, Arrow Functions, and More

PHP 7.4 introduces a suite of powerful features—including typed properties, arrow functions, limited covariance/contravariance, array unpacking, numeric literal separators, short lambda syntax, weak references, throwable __toString() and Opcache preloading—each illustrated with concise code examples for modern backend development.

Arrow FunctionsBackend DevelopmentCovariance
0 likes · 5 min read
What’s New in PHP 7.4? Typed Properties, Arrow Functions, and More