Metall  v0.29
A persistent memory allocator for data-centric analytics
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
13 extern "C" {
14 #endif
15 
21 typedef struct metall_manager metall_manager;
22 
29 metall_manager* metall_open(const char* path);
30 
38 
46 metall_manager* metall_create(const char* path);
47 
54 bool metall_snapshot(metall_manager* manager, const char* dst_path);
55 
61 
66 
75 bool metall_remove(const char* path);
76 
84 void* metall_malloc(metall_manager* manager, size_t size);
85 
92 
102 void* metall_named_malloc(metall_manager* manager, const char* name,
103  size_t size);
104 
113 void* metall_find(metall_manager* manager, const char* name);
114 
123 bool 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
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_free(metall_manager *manager, void *ptr)
Frees memory previously allocated by metall_malloc.
metall_manager * metall_open_read_only(const char *path)
Attempts to open the metall datastore at path in read only mode.
bool metall_remove(const char *path)
Removes the metall datastore at path.
metall_manager * metall_open(const char *path)
Attempts to open the metall datastore at path.
metall_manager * metall_create(const char *path)
Attempts to create a metall datastore at path.
void * metall_find(metall_manager *manager, const char *name)
Finds memory that was previously allocated using metall_named_alloc.
void * metall_malloc(metall_manager *manager, size_t size)
Allocates size bytes.
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.
basic_manager<> manager
Default Metall manager class which is an alias of basic_manager with the default template parameters.
Definition: metall.hpp:34