diff options
Diffstat (limited to 'include/bump.h')
| -rw-r--r-- | include/bump.h | 34 |
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 | |||
| 20 | struct bump { | ||
| 21 | struct buf buf; //!< Backing memory buffer. | ||
| 22 | }; | ||
| 23 | |||
| 24 | #ifndef BUMP_NO_FEAT_GPA | ||
| 25 | #include "gpa.h" | ||
| 26 | |||
| 27 | void *gpa_fun_bump (void *ctx, void *ptr, usz old_sz, usz new_sz, usz align); | ||
| 28 | struct 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 | ||
