aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-06 02:56:27 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-06 07:09:55 +0000
commit0a1b15b307c3194c8da703a3ba832ed9277b4c72 (patch)
tree3599426ae4363bd5d41dd4aa510305f4708fc3d7 /include
parentfeat(arena): add arena allocator (diff)
downloadcodebase-0a1b15b307c3194c8da703a3ba832ed9277b4c72.tar.gz
feat(bump): add bump allocator
Diffstat (limited to 'include')
-rw-r--r--include/bump.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/bump.h b/include/bump.h
new file mode 100644
index 0000000..49dbc64
--- /dev/null
+++ b/include/bump.h
@@ -0,0 +1,34 @@
1// bump.h --- bump allocator -*- C -*-
2//
3// Copyright (c) 2026 Martin Michalec <martin@michalec.dev>
4//
5// SPDX-License-Identifier: MIT
6//
7// This file is part of COSMOS Codebase.
8//
9// Commentary:
10//
11// HOLD(cmmm): add direct bump API.
12//
13// Code:
14
15#ifndef INCLUDED_COSMOS_BUMP_H
16#define INCLUDED_COSMOS_BUMP_H
17
18#include "buf.h"
19
20struct bump {
21 struct buf buf; //!< Backing memory buffer.
22};
23
24#ifndef BUMP_NO_FEAT_GPA
25#include "gpa.h"
26
27void *gpa_fun_bump (void *ctx, void *ptr, usz old_sz, usz new_sz, usz align);
28struct gpa gpa_from_bump (struct bump *);
29
30#endif // BUMP_NO_FEAT_GPA
31
32#endif // INCLUDED_COSMOS_BUMP_H
33
34// bump.h ends here