Tag

struct

0 views collected around this technical thread.

NetEase Cloud Music Tech Team
NetEase Cloud Music Tech Team
Jun 16, 2023 · Fundamentals

The Semantics of nil in Swift

The article explains that Swift’s nil differs from Objective‑C’s null pointer by representing ‘no value’ for any type through optionals, details how various optionals (Bool?, String?, class?, enum?) are encoded in memory, shows the extra byte cost for Int?, and advises minimizing optional Int fields in structs, using 0 when appropriate.

Memory OptimizationSwiftValue Types
0 likes · 6 min read
The Semantics of nil in Swift
Tencent Cloud Developer
Tencent Cloud Developer
Sep 29, 2022 · Backend Development

Analyzing Go Memory Layout and Object Dumping

The article demonstrates how to examine a running Go program’s memory layout by defining example structs, using unsafe.Sizeof/Alignof, dumping writable regions via a Bash script and GDB, and locating fields and string constants in the resulting memory dumps to verify object representation.

GoHeap InspectionLinux
0 likes · 27 min read
Analyzing Go Memory Layout and Object Dumping
360 Tech Engineering
360 Tech Engineering
Mar 6, 2020 · Fundamentals

Understanding Method Sets, Interfaces, and Embedding in Go

This article explains Go's method sets, the relationship between method receivers and method sets, how interfaces work, and the role of embedding, providing code examples that illustrate value vs pointer receivers, interface implementation rules, and embedding differences for struct types.

Goembeddinginterface{}
0 likes · 10 min read
Understanding Method Sets, Interfaces, and Embedding in Go