Metall v0.30
A persistent memory allocator for data-centric analytics
 
Loading...
Searching...
No Matches
metall.h
Go to the documentation of this file.
1// Copyright 2024 Lawrence Livermore National Security, LLC and other Metall
2// Project Developers. See the top-level COPYRIGHT file for details.
3//
4// SPDX-License-Identifier: (Apache-2.0 OR MIT)
5
6#ifndef METALL_C_API_METALL_H
7#define METALL_C_API_METALL_H
8
9#include <stdbool.h>
10#include <stddef.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
22
29metall_manager* metall_open(const char* path);
30
38
46metall_manager* metall_create(const char* path);
47
54bool metall_snapshot(metall_manager* manager, const char* dst_path);
55
61
66
75bool metall_remove(const char* path);
76
84void* metall_malloc(metall_manager* manager, size_t size);
85
91void metall_free(metall_manager* manager, void* ptr);
92
102void* metall_named_malloc(metall_manager* manager, const char* name,
103 size_t size);
104
113void* metall_find(metall_manager* manager, const char* name);
114
123bool metall_named_free(metall_manager* manager, const char* name);
124
125#ifdef __cplusplus
126}
127#endif
128
131
132#endif // METALL_C_API_METALL_H
void metall_close(metall_manager *manager)
Closes a metall manager.
bool metall_snapshot(metall_manager *manager, const char *dst_path)
Creates a snapshot of the metall datastore of manager and places it at dst_path.
struct metall_manager metall_manager
Opaque struct representing a metall manager.
Definition metall.h:21
metall_manager * metall_open_read_only(const char *path)
Attempts to open the metall datastore at path in read only mode.
void metall_free(metall_manager *manager, void *ptr)
Frees memory previously allocated by metall_malloc.
metall_manager * metall_create(const char *path)
Attempts to create a metall datastore at path.
metall_manager * metall_open(const char *path)
Attempts to open the metall datastore at path.
bool metall_remove(const char *path)
Removes the metall datastore at path.
void * metall_named_malloc(metall_manager *manager, const char *name, size_t size)
Allocates size bytes and associates the allocated memory with a name.
void * metall_malloc(metall_manager *manager, size_t size)
Allocates size bytes.
void * metall_find(metall_manager *manager, const char *name)
Finds memory that was previously allocated using metall_named_alloc.
bool metall_named_free(metall_manager *manager, const char *name)
Frees memory previously allocated by metall_named_malloc.
void metall_flush(metall_manager *manager)
Flushes the given manager.