QB_ATOMIC_POINTER_SET(3)
β¨ QB_ATOMIC_POINTER_SET(3) β¨
okay bestie, so this is a page from the libqb Programmer's Manual, and it's about exactly one (1) little function that does exactly one (1) little thing. no drama, no chaos, just pointer assignment that's also a memory barrier. iconic behavior honestly. π
πΈ NAME πΈ
qb_atomic_pointer_set β sets the value of the pointer pointed to by atomic. that's it. that's the job. she does it flawlessly. π
π¦ SYNOPSIS π¦
#include <qb/qbatomic.h>
void qb_atomic_pointer_set(
volatile void *QB_GNUC_MAY_ALIAS *atomic, /* a pointer to a void* */
void *newval /* the new value */
);
like look at her. two args. returns void. no notes. π«Ά
π PARAMS π
atomicβ a pointer to avoid*. so yeah, a pointer to a pointer. pointer-ception, lowkey. it's the thing you're aiming at. π―newvalβ the new value. the glow-up. whatatomicis about to be pointing at. β¨
π DESCRIPTION π
so you hand it atomic (a pointer to a void*) and newval (the new value), and it sets the value of the pointer pointed to by atomic. simple. clean. slay. π₯
and the little extra garnish on top: it also acts as a memory barrier. so it's not just an assignment β it's an assignment with main character energy that tells the compiler and the CPU to chill and order things properly around it. no cap. π§
fr fr, don't sleep on the memory barrier part. that's the whole reason you're using this instead of just assigning like a normal person. it's giving "trust the process." π
π SEE ALSO π
the whole atomic friend group, all linked together like a group chat you can't mute:
qb_atomic_int_set(3)qb_atomic_int_compare_and_exchange(3)qb_atomic_int_get(3)qb_atomic_int_add(3)qb_atomic_init(3)qb_atomic_pointer_get(3)qb_atomic_int_exchange_and_add(3)qb_atomic_pointer_compare_and_exchange(3)
π COPYRIGHT π
Copyright (C) 2003 Sebastian Wilhelmi
and that's the whole page, bestie!! go forth and set your pointers atomically. you're gonna ate. π β¨
this has been a LIBQB production, dated 2025-09-16, filed under QB_ATOMIC_POINTER_SET(3) β mwah, bye!! ππ¦π
π¦ where this page comes from
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- ubuntu resolute: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- ubuntu stonking: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms