---
name: "memkind_fixed"
section: "3"
platform: "linux"
package: "libmemkind-dev"
version: "1.14.0-2"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/memkind_fixed"
---

# memkind\_fixed(3)

memkind operations on user-defined memory. Note: This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed.

## NAME

memkind\_fixed - memkind operations on user-defined memory.\
 **Note:** This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed.

## SYNOPSIS

**int memkind\_fixed\_create(struct memkind** *\*kind***, struct memkind\_ops** *\*ops***, const char** *\*name***);**\
 **int memkind\_fixed\_destroy(struct memkind** *\*kind***);**\
 **void \*memkind\_fixed\_mmap(struct memkind** *\*kind***, void** *\*addr***, size\_t** *size***);**\

## DESCRIPTION

The fixed memory memkind operations enable memory kinds built on user-defined memory.  Such memory may have different attributes, depending on how the memory mapping was created.

The fixed kinds are most useful when a specific memory characteristics, e.g. numa binding, which are not fully supported by other memkind API, need to be manipulated.

The most convenient way to create fixed kinds is to use **memkind\_create\_fixed**() (see [**memkind**(3)](/memkind/3.md)).

**memkind\_fixed\_create**() is an implementation of the memkind "create" operation for kinds that are created on the memory area supplied by the user.  It allocates space for some fixed-kind-specific metadata, then calls **memkind\_arena\_create**() (see [**memkind\_arena**(3)](/memkind_arena/3.md))

**memkind\_fixed\_destroy**() is an implementation of the memkind "destroy" operation for kinds that are created on the memory area supplied by the user.  This releases all of the resources allocated by **memkind\_fixed\_create**() , but please note that it does not de-allocate the underlying memory.

**memkind\_fixed\_mmap**() allocates the file system space for a block of *size* bytes in the memory-mapped file associated with given kind. The *addr* hint is ignored.  The return value is the address of mapped memory region or **MAP\_FAILED** in the case of an error.

- Copyright (C) 2021 Intel Corporation. All rights reserved.

  ## COPYRIGHT

## SEE ALSO

[**memkind**(3)](/memkind/3.md), [**memkind\_arena**(3)](/memkind_arena/3.md), [**memkind\_default**(3)](/memkind_default/3.md), [**memkind\_hbw**(3)](/memkind_hbw/3.md), [**memkind\_hugetlb**(3)](/memkind_hugetlb/3.md), **libvmem**(3), [**jemalloc**(3)](/jemalloc/3.md), [**mbind**(2)](/mbind/2.md), [**mmap**(2)](/mmap/2.md)
