Tag

append

2 views collected around this technical thread.

Cognitive Technology Team
Cognitive Technology Team
Aug 6, 2023 · Fundamentals

Common Pitfalls When Using Go Slices and How to Avoid Them

This article explains three typical pitfalls of Go slices—ignoring the slice returned by append, unintentionally sharing the underlying array which can cause memory leaks, and the value‑copy behavior of for‑range loops—while also showing how to inspect slice internals using unsafe pointers.

CopyMemory LeakSlices
0 likes · 5 min read
Common Pitfalls When Using Go Slices and How to Avoid Them
Xueersi Online School Tech Team
Xueersi Online School Tech Team
Dec 6, 2019 · Fundamentals

Understanding Go Slice Internals: Structure, Initialization, Append, Slicing, Copy, and Parameter Passing

This article explains the internal representation of Go slices, how they are created and initialized, the mechanics of append and capacity growth, slicing behavior, deep‑copy using the copy function, and whether slices are passed by value or reference, all illustrated with source code and assembly excerpts.

CopyGoappend
0 likes · 24 min read
Understanding Go Slice Internals: Structure, Initialization, Append, Slicing, Copy, and Parameter Passing
Didi Tech
Didi Tech
Apr 18, 2019 · Backend Development

Deep Dive into Go Slices: Creation, Internals, and Append Mechanics

The article explains Go slices as three‑field descriptors pointing to an underlying array, details creation methods, shows the low‑level runtime representation and assembly for make, describes how append triggers growslice with capacity‑doubling or ~25 % growth and alignment, and clarifies sharing, nil slices, and passing semantics.

Goappendassembly
0 likes · 28 min read
Deep Dive into Go Slices: Creation, Internals, and Append Mechanics
NetEase Game Operations Platform
NetEase Game Operations Platform
Dec 15, 2018 · Fundamentals

Understanding Python List Memory Allocation and Append Behavior

This article explains how Python lists manage memory during initialization and appends, examines CPython's internal allocation algorithm, demonstrates memory growth with practical code examples, and recommends using list comprehensions for more efficient list creation.

PerformancePythonappend
0 likes · 10 min read
Understanding Python List Memory Allocation and Append Behavior