summaryrefslogtreecommitdiffstats
path: root/util/mem.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:57:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:57:49 +0000
commitfc67d3ad9a2903cc33e5cdaedaad51dd86a42236 (patch)
tree4ef72536a965fe220e71aea78b76b6bbbac2ed59 /util/mem.h
parentAdding upstream version 2.5. (diff)
downloadnvme-cli-fc67d3ad9a2903cc33e5cdaedaad51dd86a42236.tar.xz
nvme-cli-fc67d3ad9a2903cc33e5cdaedaad51dd86a42236.zip
Adding upstream version 2.7.1.upstream/2.7.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'util/mem.h')
-rw-r--r--util/mem.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/util/mem.h b/util/mem.h
new file mode 100644
index 0000000..d13eb3a
--- /dev/null
+++ b/util/mem.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef MEM_H_
+#define MEM_H_
+
+#include <stddef.h>
+#include <stdbool.h>
+
+void *nvme_alloc(size_t len);
+void *nvme_realloc(void *p, size_t len);
+
+struct nvme_mem_huge {
+ size_t len;
+ bool posix_memalign; /* p has been allocated using posix_memalign */
+ void *p;
+};
+
+void *nvme_alloc_huge(size_t len, struct nvme_mem_huge *mh);
+void nvme_free_huge(struct nvme_mem_huge *mh);
+
+#endif /* MEM_H_ */