Skip to main content

7 docs tagged with "memory"

View all tags

Allocators

Allocators are objects that manage memory allocation for STL containers. They provide a standardized interface for customizing how containers acquire and release memory.

Memory Alignment

Data arranged at addresses that are multiples of its size. Required for correctness on some architectures, critical for performance on all.

Object Layout and Memory Structure

How C++ objects are arranged in memory: data members, padding, vtables, base class subobjects. Understanding layout is crucial for binary compatibility and optimization.

Placement new

Constructs objects in pre-allocated memory without allocating. Separates construction from allocation for custom memory management.

Pointer Arithmetic

Pointer arithmetic navigates contiguous memory with automatic scaling by type size. Essential for arrays but dangerous without bounds checking.

Raw Pointers

A pointer is a variable that stores a memory address, allowing indirect access to other variables.

Storage Duration

Storage duration defines when and where objects are created and destroyed. C++ has four storage durations: automatic, static, dynamic, and thread.