Data-CuckooFilter-Shared
view release on metacpan or search on metacpan
if (hdr->rng_state == 0) hdr->rng_state = 1;
hdr->total_size = total;
hdr->reader_slots_off = L.reader_slots;
hdr->slots_off = L.slots;
__atomic_thread_fence(__ATOMIC_SEQ_CST);
}
static inline uint16_t *cf_slots(CfHandle *h) {
/* Layer B: locate the slot array via the trusted compile-time layout, NOT
* the attacker-writable hdr->slots_off -- a peer that corrupts slots_off in
* shared memory must not be able to relocate the base outside the mapping.
* Validation at open guarantees hdr->slots_off == cf_layout().slots for a
* valid filter, so this is identical for valid data. */
return (uint16_t *)((char *)h->base + cf_layout().slots);
}
static inline CfHandle *cf_setup(void *base, size_t map_size,
const char *path, int backing_fd) {
CfHeader *hdr = (CfHeader *)base;
CfHandle *h = (CfHandle *)calloc(1, sizeof(CfHandle));
if (!h) {
( run in 2.046 seconds using v1.01-cache-2.11-cpan-941387dca55 )