Blame src/memkind_interleave.c

Packit Service 724aca
/*
Packit Service 724aca
 * Copyright (C) 2015 - 2019 Intel Corporation.
Packit Service 724aca
 * All rights reserved.
Packit Service 724aca
 *
Packit Service 724aca
 * Redistribution and use in source and binary forms, with or without
Packit Service 724aca
 * modification, are permitted provided that the following conditions are met:
Packit Service 724aca
 * 1. Redistributions of source code must retain the above copyright notice(s),
Packit Service 724aca
 *    this list of conditions and the following disclaimer.
Packit Service 724aca
 * 2. Redistributions in binary form must reproduce the above copyright notice(s),
Packit Service 724aca
 *    this list of conditions and the following disclaimer in the documentation
Packit Service 724aca
 *    and/or other materials provided with the distribution.
Packit Service 724aca
 *
Packit Service 724aca
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
Packit Service 724aca
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
Packit Service 724aca
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
Packit Service 724aca
 * EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
Packit Service 724aca
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Packit Service 724aca
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
Packit Service 724aca
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
Packit Service 724aca
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
Packit Service 724aca
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
Packit Service 724aca
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit Service 724aca
 */
Packit Service 724aca
Packit Service 724aca
#include <memkind/internal/memkind_interleave.h>
Packit Service 724aca
#include <memkind/internal/memkind_default.h>
Packit Service 724aca
#include <memkind/internal/memkind_arena.h>
Packit Service 724aca
#include <memkind/internal/memkind_private.h>
Packit Service 724aca
Packit Service 724aca
MEMKIND_EXPORT struct memkind_ops MEMKIND_INTERLEAVE_OPS = {
Packit Service 724aca
    .create = memkind_arena_create,
Packit Service 724aca
    .destroy = memkind_default_destroy,
Packit Service 724aca
    .malloc = memkind_arena_malloc,
Packit Service 724aca
    .calloc = memkind_arena_calloc,
Packit Service 724aca
    .posix_memalign = memkind_arena_posix_memalign,
Packit Service 724aca
    .realloc = memkind_arena_realloc,
Packit Service 724aca
    .free = memkind_arena_free,
Packit Service 724aca
    .mbind = memkind_default_mbind,
Packit Service 724aca
    .madvise = memkind_nohugepage_madvise,
Packit Service 724aca
    .get_mmap_flags = memkind_default_get_mmap_flags,
Packit Service 724aca
    .get_mbind_mode = memkind_interleave_get_mbind_mode,
Packit Service 724aca
    .get_mbind_nodemask = memkind_default_get_mbind_nodemask,
Packit Service 724aca
    .get_arena = memkind_thread_get_arena,
Packit Service 724aca
    .init_once = memkind_interleave_init_once,
Packit Service 724aca
    .malloc_usable_size = memkind_default_malloc_usable_size,
Packit Service 724aca
    .finalize = memkind_arena_finalize,
Packit Service 724aca
    .get_stat = memkind_arena_get_kind_stat,
Packit Service 724aca
    .defrag_reallocate = memkind_arena_defrag_reallocate
Packit Service 724aca
};
Packit Service 724aca
Packit Service 724aca
MEMKIND_EXPORT void memkind_interleave_init_once(void)
Packit Service 724aca
{
Packit Service 724aca
    memkind_init(MEMKIND_INTERLEAVE, true);
Packit Service 724aca
}