Data-Log-Shared

 view release on metacpan or  search on metacpan

Shared.xs  view on Meta::CPAN

    RETVAL = (off >= 0) ? newSViv((IV)off) : &PL_sv_undef;
  OUTPUT:
    RETVAL

void
read_entry(self, offset, ...)
    SV *self
    UV offset
  PREINIT:
    EXTRACT_LOG(self);
  PPCODE:
    const uint8_t *out_data;
    uint32_t out_len;
    uint64_t next_off;
    /* Optional third arg: abandon_wait_us (default LOG_ABANDON_WAIT_US).
     * Pass 0 to immediately treat any uncommitted slot as abandoned. */
    uint64_t wait_us = (items > 2) ? (uint64_t)SvUV(ST(2)) : (uint64_t)LOG_ABANDON_WAIT_US;
    int rc = log_read_ex(h, offset, &out_data, &out_len, &next_off, wait_us);
    if (rc == LOG_READ_OK) {
        EXTEND(SP, 2);
        PUSHs(sv_2mortal(newSVpvn((const char *)out_data, out_len)));



( run in 1.137 second using v1.01-cache-2.11-cpan-5511b514fd6 )