CK_ARRAY_PUT(3)
π CK_ARRAY_PUT(3) π
okay bestie, welcome to the ck_array_put page β yes it's from the Concurrency Kit (that's libck, link it with -lck) and it's literally one of the most-used little functions in the whole array saga. sit down, grab a strawberry π, let's get into it.
πΈ NAME πΈ
ck_array_put β attempt immediate or deferred insertion of a pointer into array
like... you're sliding a pointer into an array and the array gets to decide when it actually lands there. iconic behavior tbh. β¨
π LIBRARY π
Concurrency Kit (that's libck, so you link with -lck) π«Ά
π SYNOPSIS π
#include <ck_array.h>
bool
ck_array_put(ck_array_t *array, void *pointer);
two arguments, one bool, no drama. we love a minimal signature. π
β¨ DESCRIPTION β¨
So the way that ck_array_put(3) works is: it attempts to insert the value of pointer into the array that array points to. that's the whole vibe.
But heads up β this function may incur additional memory allocations if there isn't already enough memory allocated in the array to hold a new entry. so like, it might go shopping for more memory mid-operation. no cap, that's just how it is. π
Also, plot twist: the operation is free to apply the operation immediately if there's an opportunity for elimination with a pending (uncommitted) remove operation. so if a remove is just sitting there uncommitted and it could cancel out with your put β yeah, it might just go ahead and do that right then and there. it's giving β¨opportunisticβ¨. the array is the main character here, not you. π
π RETURN VALUES π
trueβ slay, the put operation succeeded. πfalseβ otherwise, and the reason is internal allocation failures. π
that's it, that's the return value situation.
π SEE ALSO π
go read these next, they're all part of the same friend group:
ck_array_init(3)ck_array_commit(3)ck_array_put_unique(3)ck_array_remove(3)ck_array_deinit(3)ck_array_length(3)ck_array_buffer(3)ck_array_initialized(3)CK_ARRAY_FOREACH(3)
and if you want even more info, additional information is available at http://concurrencykit.org/ π
okay that's the whole page, you ate that. this one's dated October 18, 2013 and it lives under the name CK_ARRAY_PUT(3) β go forth and insert responsibly, bestie. mwah. ππ¦
π¦ where this page comes from
- alpine 3.24: ck-doc 0.7.2-r1 Β· BSD-2-Clause AND Apache-2.0
- debian bookworm: libck-dev 0.7.1-10 Β· BSD-2-Clause
- debian trixie: libck-dev 0.7.2-6 Β· BSD-2-Clause
- epel 10: ck-devel 0.7.2-1.el10_1 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- epel 9: ck-devel 0.7.0-10.el9 Β· BSD
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- nixos 26.05: ck 0.7.2
- nixpkgs unstable: ck 0.7.2
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- ubuntu jammy: libck-dev 0.7.1-6ubuntu2 Β· BSD-2-Clause
- ubuntu noble: libck-dev 0.7.1-13build1 Β· BSD-2-Clause
- ubuntu questing: libck-dev 0.7.2-5ubuntu1
- ubuntu resolute: libck-dev 0.7.2-5ubuntu2 Β· BSD-2-Clause
- ubuntu stonking: libck-dev 0.7.2-11 Β· BSD-2-Clause
- Copyright 2013 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms