33#define MOQCACHE_HDR 32
37#define MOQCACHE_OBJ_MAX (65536 - 64)
41#define MOQCACHE_OBJ_ID_MAX 0x3FFFFFFFFFFFFFFFULL
void moqcache_init(moqcache *c, u8 *arena, usz cap)
An empty cache over arena[0..cap); cap 0 caches nothing.
void moqcache_append(moqcache *c, u64 tag, u64 group, u64 object, wired_span payload)
Caches Object {group, object} of tag (rules above).
void moqcache_release(moqcache *c, u64 tag)
Drops every record of tag (its publisher left).
moqctl_loc moqcache_skip(moqcache *c, u64 tag, moqctl_loc cur, moqctl_loc end)
cur moved past Locations known not to exist (the rest of a cached group, groups between cached ones),...
void moqcache_item_at(moqcache *c, u64 tag, moqctl_loc cur, moqctl_loc end, moqcache_item *it)
The item at cur (a moqcache_skip result below end).
draft-ietf-moq-transport-19 SS10 Control Messages: common envelope (Type + 16-bit Length + Body),...
One FETCH response item at a cursor: an Object (unknown 0, payload a view into the arena,...
Definition moqcache.h:62
moqctl_loc loc
The Object's Location, or the unknown range's last Location.
Definition moqcache.h:66
int unknown
1 for an End of Unknown Range, 0 for a cached Object.
Definition moqcache.h:64
moqctl_loc next
Location right after this item: where the next lookup starts.
Definition moqcache.h:71
wired_span payload
Object payload (view into the arena, valid until the next append/release); empty for an unknown range...
Definition moqcache.h:69
A FETCH object cache over one caller-owned arena.
Definition moqcache.h:44
usz used
bytes of records held, from arena[0]
Definition moqcache.h:48
usz hint_off
Resume point: the last lookup of hint_tag at hint_cur found hint_off; 0 (scan from the start) after a...
Definition moqcache.h:51
usz cap
arena bytes: the budget
Definition moqcache.h:47
u64 hint_tag
The tag that lookup was for.
Definition moqcache.h:53
moqctl_loc hint_cur
The Location that lookup was for.
Definition moqcache.h:55
u8 * arena
Caller-provided storage; must outlive the cache.
Definition moqcache.h:46
draft-ietf-moq-transport-19 SS1.4.2 Location: two consecutive varints.
Definition moqctl.h:392
Read-only view of a byte range.
Definition span.h:30
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned char u8
unsigned 8-bit integer / byte
Definition types.h:18
unsigned long u64
unsigned 64-bit integer
Definition types.h:13