Tagged articles

new

9 articles · Page 1 of 1
Golang Shines
Golang Shines
Mar 12, 2026 · Fundamentals

Why Go Requires Both new and make for Memory Allocation

Go provides two distinct constructors—new, a generic memory allocator returning a zero‑initialized pointer, and make, a specialized initializer that allocates and prepares slices, maps, and channels—explaining why both exist, how they differ, common pitfalls, and the language’s design philosophy of explicit, ready‑to‑use values.

Gochannelmake
0 likes · 8 min read
Why Go Requires Both new and make for Memory Allocation
Golang Shines
Golang Shines
Feb 6, 2026 · Fundamentals

Go 1.26 Extends built‑in new to Accept Arbitrary Expressions

Go 1.26 adds a new capability to the built‑in new function, allowing it to take any expression, copy the result into a temporary variable and return a pointer, which eliminates the need for helper functions, prevents hidden memory leaks and yields measurable performance gains, as shown by concrete benchmarks and compiler‑level escape‑analysis explanations.

Escape AnalysisGoMemory management
0 likes · 8 min read
Go 1.26 Extends built‑in new to Accept Arbitrary Expressions
Go Development Architecture Practice
Go Development Architecture Practice
Oct 23, 2025 · Fundamentals

How Go 1.26’s new Built‑in ‘new’ Accepts Any Expression – Simplify Code and Boost Performance

The article explains the background and need for helper functions that return pointers to values in Go, introduces the upcoming Go 1.26 extension that lets the built‑in new function accept arbitrary expressions, shows practical code examples, demonstrates memory‑leak avoidance and performance gains, and concludes with a brief outlook on the feature’s release.

GoMemoryPerformance
0 likes · 8 min read
How Go 1.26’s new Built‑in ‘new’ Accepts Any Expression – Simplify Code and Boost Performance
Deepin Linux
Deepin Linux
Sep 17, 2025 · Fundamentals

Why new/delete Beats malloc/free: A Deep Dive into C/C++ Memory Management

This article explains the core differences between C's malloc/free and C++'s new/delete, covering allocation mechanisms, object construction and destruction, error handling, common pitfalls, and best practices—including smart pointers—to help developers choose the right memory management approach for various programming scenarios.

C++allocationmalloc
0 likes · 32 min read
Why new/delete Beats malloc/free: A Deep Dive into C/C++ Memory Management
Deepin Linux
Deepin Linux
Aug 23, 2025 · Fundamentals

How Does delete Know Memory Size? A Deep Dive into C++ Memory Management

This article explains C++ memory management fundamentals, detailing how delete and free release memory without explicit size knowledge, the role of stack, heap, data and code segments, differences between new/delete and malloc/free, array handling, common pitfalls, and interview questions with code examples.

C++FreeMemory management
0 likes · 34 min read
How Does delete Know Memory Size? A Deep Dive into C++ Memory Management
Code Mala Tang
Code Mala Tang
Jun 19, 2025 · Fundamentals

What Really Creates Python Objects? Unveiling __new__ vs __init__

This article explains how Python actually creates objects, clarifying the distinct roles of the __new__ and __init__ methods, and demonstrates practical techniques such as inheriting immutable types, adding metadata, and implementing singleton patterns through custom object creation.

Pythondesign-patternsimmutability
0 likes · 13 min read
What Really Creates Python Objects? Unveiling __new__ vs __init__