splinter_unset Splinter API Reference

The purpose of splinter_unset is to delete a key: it atomically zeroes the slot hash to mark it available, then zeroes the used key and value regions and resets the slot.

Forward Declaration & Use

int splinter_unset(const char *key) <splinter.h>

int freed = splinter_unset("greeting");
if (freed >= 0)
    printf("freed %d bytes\n", freed);

Return & Rationale

Return Behavior: Returns the length of the value deleted, -1 if the key is not found, or -2 on a NULL key/store.

Errno Behavior: None.

Rationale (Or None): Zeroing the hash first marks the slot writable in a single atomic operation; clearing the key and value regions afterward prevents stale data from lingering. This is classified as a DESTRUCTIVE operation in the AI Primer.

See Also

Relevant Symbols (Or None): splinter_set, splinter_client_unset_tandem, splinter_unset_label