static int _map_reserve(epoll_t* epoll, size_t new_capacity)
{
    int ret = -1;

    new_capacity = oe_round_up_to_multiple(new_capacity, MAP_CHUNK_SIZE);

    if (new_capacity > epoll->map_capacity)
    {
        mapping_t* p;
        const size_t n = new_capacity;

        /* Reallocate the table. */
        if (!(p = oe_realloc(epoll->map, n * sizeof(mapping_t))))
            goto done;

        /* Zero-fill the unused portion. */
        {
            const size_t num_bytes = (n - epoll->map_size) * sizeof(mapping_t);
            void* ptr = p + epoll->map_size;

            if (oe_memset_s(ptr, num_bytes, 0, num_bytes) != OE_OK)
                goto done;
        }

        epoll->map = p;
        epoll->map_capacity = n;
    }

    ret = 0;

done:
    return ret;
}
static int _map_reserve(epoll_t* epoll, size_t new_capacity)
{
    int ret = -1;

    new_capacity = oe_round_up_to_multiple(new_capacity, MAP_CHUNK_SIZE);

    if (new_capacity > epoll->map_capacity)
    {
        mapping_t* p;
        const size_t n = new_capacity;

         
        if (!(p = oe_realloc(epoll->map, n * sizeof(mapping_t))))
            goto done;

         
        {
            const size_t num_bytes = (n - epoll->map_size) * sizeof(mapping_t);
            void* ptr = p + epoll->map_size;

            if (oe_memset_s(ptr, num_bytes, 0, num_bytes) != OE_OK)
                goto done;
        }

        epoll->map = p;
        epoll->map_capacity = n;
    }

    ret = 0;

done:
    return ret;
}