skipNewList(3)

πŸ’– skipNewList(3) πŸ’–

okay bestie, so this one lives in util/skiplist.h and it's literally the birth of a skip list. like, the glow-up origin story. we're creating a whole new skip list from scratch and honestly? iconic. πŸ¦‹


✨ NAME ✨

skipNewList β€” create a skip list. that's it. that's the whole job. she's a maker, a builder, a main character. πŸ’…


🌸 SYNOPSIS 🌸

#include <util/skiplist.h>

NEOERR *skipNewList(skipList *skip, int threaded, int root, int maxLevel,
                     int flushLimit, skipFreeValue freeValue, void *ctx);

πŸŽ€ ARGUMENTS πŸŽ€

  • threaded β€” set this to true if the list should be thread-safe. like, do you need her to survive being passed around by multiple threads at once? yes? then true. πŸ’ͺ
  • root β€” a performance parameter (peep the discussion above for the whole tea). β˜•
  • maxLevel β€” also a performance parameter (again, see above, iykyk).
  • flushLimit β€” the max number of deleted items she keeps cached before she's forced to flush. she has a limit, and she means it.
  • freeValue β€” a callback that gets made whenever a value is flushed. so like, every time a value gets yeeted, this runs. 🫑
  • ctx β€” the context you pass on over to freeValue. it's the lil gift bag she carries to the callback. 🎁

πŸ¦‹ DESCRIPTION πŸ¦‹

she returns a brand new skip list, periodt. ✨

if <threaded> is true, the list is multi-thread safe. multiple threads, one list, no chaos. slay.

<root> and <maxLevel> are the performance + expected-size girlies β€” they decide how fast she goes and how big she's planning to be (the discussion above has the full breakdown, go read it bestie).

<flushLimit> is for threaded lists only, and it sets the maximum number of deleted items that get kept cached during concurrent searches. once that limit is hit, new concurrent reads get BLOCKED until all the deleted items are flushed out. so like… she stops taking new readers until she finishes cleaning. it's giving spring cleaning energy and honestly, respect.

MT-Level: Safe. πŸ’š no cap, she's safe for multithreading.

🌈 RETURN VALUE 🌈

None. she returns nothing. she just does. πŸ’…


⭐ SEE ALSO ⭐


and that's the whole page bestie!! brought to you by ClearSilver, dated 12 July 2007 β€” an absolute vintage queen, and yes she still ate. πŸ‘‘πŸ’– mwah, go build some skip lists. πŸŽ€