Skip to main content

37 docs tagged with "memory"

View all tags

Address Space and Memory Model

Virtual address width, page granularity, alignment and the ordering contract that lets x86-64, ARM64 and RISC-V programs agree on what a shared memory write means.

Atomics and Synchronization

How a read-modify-write grabs a cache line exclusively, why LL/SC fails spuriously, and when a queue lock or futex beats a spinning test-and-set.

Bits, Bytes and Layout

Bit and byte conventions, byte order, alignment and padding, and the object layout rules that decide what a binary format looks like.

Cache Coherence

The single-writer invariant, MESI and MOESI state machines, and why snooping gives way to directories as core counts grow.

Cache Organization

The tag-index-offset split, direct-mapped versus set-associative lookup, line size and index translation, and the numbers that decide hit rate and hit time.

Concept

C 的抽象机器只有对象与函数:没有运行时、手工管理生命周期、以未定义行为换取零开销,用翻译单元与链接器拼装程序;本页给出这套模型的取舍与判断标准。

DDR, HBM and Persistent Memory

How the DRAM interface evolved from one 64-bit channel to DDR5 subchannels, stacked HBM, persistent DIMMs and CXL memory, and what each costs in latency and bandwidth.

Feature: Interop

The five unsafe abilities, the invariants they transfer to the developer, and the ABI contract at a foreign function boundary.

Feature: Move Semantics

C++ 的移动语义:值类别、移动构造/赋值、转发引用、完美转发、RVO/NRVO 与 std::move 的误用。

Feature: RAII

RAII 用对象生命周期管理资源:规则 0/5、智能指针、异常安全与 scope guard。

Hardware (Legacy)

Superseded by the Hardware domain; kept while its content moves into the new pages.

Hierarchy and AMAT

The capacity-latency ladder from registers to disk, the AMAT identity that prices it, and how locality turns a hundred-nanosecond miss into a one-nanosecond average.

Interleaving and Bandwidth

How physical addresses are striped across channels, banks and ranks, why stride and granularity decide the achieved bandwidth, and how to measure the gap to the theoretical peak.

Interop: C ABI and Bindings

C++ 与外部世界的边界以 C ABI 为稳定层,pybind11、JNI 与 N-API 各自负责类型、所有权与异常的翻译,跨边界的字符串、容器与回调生命周期决定集成是否可靠。

Interop: C ABI and Foreign Calls

C ABI 是各语言共同的最低边界:C++ 的 C 链接声明、cgo、ctypes/cffi、JNI、N-API 与 dlopen 各自把同一份调用约定翻译成本语言的对象,本页给出结构布局、所有权、错误映射与回调生命周期的判据。

Memory Consistency

What SC, TSO and the weak models allow, how store buffers make write-read reordering the default, and how acquire and release pin it back down.

Memory Management

Virtual memory, paging and segmentation: the address space, the page table and the cost of a miss.

Misses, Prefetch and Blocking

The three Cs plus coherence, non-blocking caches and MSHRs, hardware and software prefetch, and cache blocking as the software answer to a working set that will not fit.

Multilevel and Inclusion

Private L1 and L2 behind a shared L3: what inclusive, exclusive and non-inclusive caches cost in effective capacity, snoop filtering and back-invalidation traffic.

NUMA

Nodes, distance matrices and first-touch allocation: why a remote page costs 1.5 to 2 times a local one and how to bind CPU and memory together.

Page Faults and Working Set

Fault classes and their costs, the kernel path that fills a missing PTE, and why the working set rather than RSS decides whether memory is enough.

Paging and Page Tables

The virtual-address split, the four- or five-level radix tree that maps it, and the PTE bits that carry protection, presence and dirty state.

Replacement and Write Policy

How a set chooses the line to evict and how a write reaches the next level: LRU and its approximations, write-back versus write-through, and the traffic each choice costs.

Runtime: Class Loading

The class file, the loading and linking phases, class loader hierarchy, reflection and the leaks a class loader can hold.

Runtime: Memory and GC

Runtime data areas, allocation, the garbage collectors compared, pause budgets and the OOM types that follow.

Runtime: Memory Layout and Allocation

C 进程的地址空间由代码、数据、堆、栈与 TLS 组成,本页给出各段的边界、malloc 的实现与阈值、碎片和泄漏的判据以及分配器选型。

Runtime: Memory Layout and Allocation

C++ 运行期内存:operator new/delete 的完整重载族、sized 与 aligned 分配、allocator 与 placement new、存储期与生命周期、std::launder 与 sanitizer 信号。

Runtime: Object Model and ABI

C 的 ABI 把对象布局、对齐、寄存器分配、结构体传递与变参协议固定成二进制契约,本页给出 SysV AMD64 与 Windows x64 的可验证规则和跨边界选择。

Runtime: Object Model and ABI

C++ 对象模型与 ABI:Itanium 与 MSVC 的名字修饰、vtable/vptr 与 RTTI 布局、多继承与虚继承的指针调整、ABI 稳定性以及 C 语言链接边界。

SRAM and DRAM

The two cells behind every level of the hierarchy: a 6T latch that holds a bit and a 1T1C capacitor that leaks one, with the density, timing and refresh contracts each imposes.

TLB

How a small translation cache turns a four-level walk into one lookup, why its reach matters more than its hit rate, and what a shootdown really costs.

Type

C 的类型是对象表示、对齐与合法操作的组合:sizeof 与 offsetof 可算出布局,整数转换按秩与符号进行,数组在表达式里退化为指针,union 与位域则把可移植性押在实现上。

Type

C++ 的静态类型系统:引用、cv 限定、auto/decltype 推导、转换序列、type traits 与类型类别。

Type

Go 的值模型:基本类型与零值、显式转换和类型身份、常量与 iota 的求值、string/byte/rune 的 UTF-8 边界、slice 头的 len/cap、append 扩容与别名、map 的引用语义、struct 对齐填充、指针复制语义、可比较规则,以及逃逸分析如何决定栈或堆。

Type

How CPython compiles and executes a module, how names bind to objects, how reference counting and the cyclic GC decide a lifetime, and how protocols decide identity, equality and attribute access.

Type

One owner per value, borrows checked at compile time, and lifetimes that bound how long a reference stays valid.

Virtualization Support

Root and non-root CPU modes, two-dimensional paging with EPT or NPT, and the exit and nested-walk costs that set a guest apart from bare metal.