SbStorage(3)
π SbStorage π
okay bestie, so this is a page from the Library Functions Manual β the SbStorage(3) one β and it's literally all about thread-local memory. she's giving "quiet static data, but make it per-thread" energy. let's get into it π«Ά
β¨ NAME β¨
SbStorage β the SbStorage class manages thread-local memory. periodt.
πΈ SYNOPSIS πΈ
#include <Inventor/threads/SbStorage.h>
π Public Member Functions
SbStorage (unsigned int size)
SbStorage (unsigned int size, void(*constr)(void *), void(*destr)(void *))
~SbStorage (void)
void * get (void)
void applyToAll (SbStorageApplyFunc *func, void *closure)
π¦ Detailed Description π¦
The SbStorage class manages thread-local memory.
This class manages thread-local memory. When different threads access the memory an SbStorage object manages, they will receive different memory blocks back. no cap, each thread gets its own lil stash π
This provides a mechanism for sharing read/write static data. iconic behaviour tbh.
One important implementation detail: if the Coin library was explicitly configured to be built without multi-platform thread abstractions, or neither pthreads nor native Win32 thread functions are available, it will be assumed that the client code will all run in the same thread. Which means π the same memory block will be returned for any request without considering the current thread id. so likeβ¦ everyone's sharing the same brain cell in that case, lowkey π
π Constructor & Destructor Documentation π
π SbStorage::SbStorage (unsigned int size) [inline]
Constructor. size specifies the number of bytes each thread should have in this thread-local memory management object. that's your per-thread allowance, bestie, spend it wisely β¨
π SbStorage::SbStorage (unsigned int size, void(* constr )(void *), void(* destr )(void *)) [inline]
Constructor. size specifies the number of bytes each thread should have in this thread-local memory management object. A constructor and a destructor functions can be given that will be called when the actual memory blocks are allocated and freed. so like, constr runs on the glow-up moment (allocation) and destr runs on the goodbye moment (freeing) π₯Ή
π SbStorage::~SbStorage (void ) [inline]
The destructor. she's leaving, but gracefully π
π Member Function Documentation π
β void * SbStorage::get (void ) [inline]
This method returns the calling thread's thread-local memory block. your block, specifically β not your neighbour's. main character energy fr fr.
β void SbStorage::applyToAll (SbStorageApplyFunc * func, void * closure) [inline]
This method will call func for all thread local storage data. closure will be supplied as the second parameter to the callback. so it's a little group-chat roll call for every thread's storage π£β¨
π§ Author π§
Generated automatically by Doxygen for Coin from the source code. (not a human, just vibes and tooling π«Ά)
heads up bestie: those[inline]tags and the exact signatures are doing real work β don't be out here renamingfuncorclosure, okay? iykyk πΈ
and that's the whole page, queen π it came from Coin, Version 2.5.0, dated as SbStorage(3) β so go forth and keep your threads' memories cute and separate πβ¨π
π¦ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms