objagg_create(9)
β¨ objagg_create(9) β¨
okay bestie, welcome to the Kernel API Manual β this one's from objagg_create(9) and it's literally the moment a brand-new objagg instance gets born π
πΈ NAME πΈ
objagg_create β creates a new objagg instance π
β¨ SYNOPSIS β¨
struct objagg * objagg_create (const struct objagg_ops *ops , struct
objagg_hints *objagg_hints , void *priv );
π¦ ARGUMENTS π¦
opsβ your user-specific callbacks, like the whole personality of the thing πobjagg_hintsβ the hints, and no cap: this one can beNULLπprivβ a pointer to private data that gets passed along to theopsπ«Ά
π NOTE π
Real talk first: all locking must be provided by the caller. The library is not doing that for you, periodt. π₯
So here's the vibe β the whole purpose of this library is to give you an infrastructure to aggregate user-specified objects. It literally does not care what type your object is, bestie. You fill up ops and those take care of the specific user object manipulation. main character energy: yours. β¨
As a very stupid example (their words, not mine π), consider integer numbers. For example number 8 as a root object. That can aggregate number 9 with delta 1, number 10 with delta 2, etc. That example is implemented as a part of a testing module in the test_objagg.c file β iconic of them honestly π§
Each objagg instance contains multiple trees π³. Each tree node is represented by "an object". In the current implementation there can be only roots and leafs nodes. Leaf nodes are called deltas. But in general, this can be easily extended for intermediate nodes. In that extension, a delta would be associated with all non-root nodes. Lowkey love a library that plans ahead π
And the return situation: it returns a pointer to a newly created objagg instance in case of success π β otherwise it returns a pointer error using the ERR_PTR macro π so like, check that pointer, okay?
π SEE ALSO π
- Kernel file
./lib/objagg.c objagg_obj_root_priv(9)objagg_obj_delta_priv(9)objagg_obj_raw(9)objagg_obj_get(9)objagg_obj_put(9)objagg_destroy(9)objagg_stats_get(9)objagg_stats_put(9)objagg_hints_get(9)objagg_hints_put(9)objagg_hints_stats_get(9)
and that's the whole page, bestie π this cutie lives in ./lib and the manual's dated October 2026 β go forth and aggregate, iykyk π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms