List-SomeUtils-XS

 view release on metacpan or  search on metacpan

XS.xs  view on Meta::CPAN

{
    EACH_ARRAY_BODY;
}
OUTPUT:
    RETVAL

void
pairwise (code, ...)
    SV *code;
PROTOTYPE: &\@\@
PPCODE:
{
#define av_items(a) (av_len(a)+1)

    /* This function is not quite as efficient as it ought to be: We call
     * 'code' multiple times and want to gather its return values all in one
     * list. However, each call resets the stack pointer so there is no
     * obvious way to get the return values onto the stack without making
     * intermediate copies of the pointers.  The above disabled solution would
     * be more efficient. Unfortunately it doesn't work (and, as of now,
     * wouldn't deal with 'code' returning more than one value).

XS.xs  view on Meta::CPAN

        } while (i <= j);
        POP_MULTICALL;
    }
}
OUTPUT:
    RETVAL

void
mode (...)
PROTOTYPE: @
PPCODE:
{
    int i;
    unsigned int max = 0;
    unsigned int c = 0;
    unsigned int modality = 0;
    SV **args = &PL_stack_base[ax];
    HV *hv = newHV();
    SV *tmp = sv_newmortal();
    HE *he;



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