logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

TickitString - a reference-counted string buffer

Description

A TickitString instance stores a NUL-terminated character buffer (i.e. a plain C string) and a reference count. It allows string buffers to be efficiently shared while their usage is tracked, and reclaimed once no longer required.

Functions

A new TickitString instance is created by calling tickit_string_new(3). Once constructed, its buffer can be read by calling tickit_string_get(3) and its length queried by tickit_string_len(3). The buffer should be considered immutable; it cannot be modified. A string instance maintains a reference count to make it easier for applications to share and manage the lifetime of these buffers. A new string starts with a count of one, and it can be adjusted using tickit_string_ref(3) and tickit_string_unref(3). When the count reaches zero the instance is destroyed.

Name

TickitString - a reference-counted string buffer

See Also

tickit(7) TICKIT_STRING(7)

Synopsis

#include<tickit.h>typedefstructTickitString;

See Also