sixel_allocator_calloc(
    sixel_allocator_t   /* in */ *allocator,  /* allocator object */
    size_t              /* in */ nelm,        /* number of elements */
    size_t              /* in */ elsize)      /* size of element */
{
    size_t n;

    /* precondition */
    assert(allocator);
    assert(allocator->fn_calloc);

    n = nelm * elsize;

    if (n == 0) {
        sixel_helper_set_additional_message(
            "sixel_allocator_malloc: called with n == 0");
        return NULL;
    }

    if (n > SIXEL_ALLOCATE_BYTES_MAX) {
        return NULL;
    }

    return allocator->fn_calloc(nelm, elsize);
}
sixel_allocator_calloc(
    sixel_allocator_t     *allocator,   
    size_t                nelm,         
    size_t                elsize)       
{
    size_t n;

     
    assert(allocator);
    assert(allocator->fn_calloc);

    n = nelm * elsize;

    if (n == 0) {
        sixel_helper_set_additional_message(
            "sixel_allocator_malloc: called with n == 0");
        return NULL;
    }

    if (n > SIXEL_ALLOCATE_BYTES_MAX) {
        return NULL;
    }

    return allocator->fn_calloc(nelm, elsize);
}