SMR_PTR_GET(9)
π SMR_PTR_GET(9) β safe memory reclamation pointer API π
okay bestie, this is the SMR_PTR_GET(9) page from the Kernel Developer's Manual, and itβs giving safe memory reclamation pointer API realness. no cap, weβre about to get into the pointer macros. π
β¨ NAME β¨
SMR_PTR_GET, SMR_PTR_GET_LOCKED, SMR_PTR_SET_LOCKED β safe memory reclamation pointer API. three macros, one cute lil family. π«Ά
πΈ SYNOPSIS πΈ
TYPE
SMR_PTR_GET(TYPE *pptr);
TYPE
SMR_PTR_GET_LOCKED(TYPE *pptr);
void
SMR_PTR_SET_LOCKED(TYPE *pptr, TYPE v);
π¦ DESCRIPTION π¦
The SMR_PTR macros are used for accessing SMR-protected pointers. thatβs the whole assignment, and they ate. π
SMR_PTR_GET()β reads the pointer referenced bypptrfor dereferencing inside SMR read-side critical section. read-side bestie behavior, literally.SMR_PTR_GET_LOCKED()β reads the pointer referenced bypptrfor dereferencing inside writer context. writer-context energy only. πSMR_PTR_SET_LOCKED()β writes valuevto the pointer referenced bypptr. The operation issues a write-write memory barrier withmembar_producer(9)before the pointer write. barrier first, then the write, periodt. π₯
π CONTEXT π
SMR_PTR_GET(), SMR_PTR_GET_LOCKED() and SMR_PTR_SET_LOCKED() can be called during autoconf, from process context, or from interrupt context. yes, all three, no cap.
SMR_PTR_GET()can be used from SMR read-side critical section.SMR_PTR_GET_LOCKED()andSMR_PTR_SET_LOCKED()can be used from writer context.
π SEE ALSO π
membar_producer(9)SMR_LIST_INIT(9)smr_read_enter(9)
go read these next, bestie, iykyk. π
β HISTORY β
The SMR_PTR macros first appeared in OpenBSD 6.5. iconic origin story, fr fr. π
okay thatβs the page! π this one is from Debian, dated July 5, 2019, for SMR_PTR_GET(9) β mwah, bestie. πβ¨
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2019 Visa Hankala
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms