Data-TopK-Shared
view release on metacpan or search on metacpan
tk_rwlock_rdunlock(h);
RETVAL = (h->mode == TK_MODE_DECAYED) ? newSVnv(tk_w_get(err) / g) : newSVuv((UV)err);
OUTPUT:
RETVAL
void
top(self, ...)
SV *self
PREINIT:
EXTRACT(self);
PPCODE:
{
UV k = (items > 1 && (SvGETMAGIC(ST(1)), SvOK(ST(1)))) ? SvUV(ST(1)) : 0; /* optional; undef/omitted = 0 = all */
TkEnt *ents = NULL;
char *keys = NULL;
REEXTRACT(self);
uint64_t used, ks = h->key_size, i, cap = h->capacity;
/* Allocate worst-case snapshot buffers (all `capacity` slots) BEFORE the
lock: Newx can croak on OOM, and under the read lock that longjmp would
strand the lock. `used` (below) is clamped to capacity, so these fit. */
if (cap) {
( run in 1.776 second using v1.01-cache-2.11-cpan-92ad3014f07 )