libghostty-vt
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
allocator.h
Go to the documentation of this file.
1
6
7
#ifndef GHOSTTY_VT_ALLOCATOR_H
8
#define GHOSTTY_VT_ALLOCATOR_H
9
10
#include <stdbool.h>
11
#include <stddef.h>
12
#include <stdint.h>
13
#include <
ghostty/vt/types.h
>
14
35
50
typedef
void
* (*GhosttyAllocatorAllocFn)(
void
*ctx,
size_t
len, uint8_t alignment, uintptr_t ret_addr);
51
99
typedef
bool (*
GhosttyAllocatorResizeFn
)(
void
*ctx,
void
*memory,
size_t
memory_len, uint8_t alignment,
size_t
new_len, uintptr_t ret_addr);
100
124
typedef
void
* (*GhosttyAllocatorRemapFn)(
void
*ctx,
void
*memory,
size_t
memory_len, uint8_t alignment,
size_t
new_len, uintptr_t ret_addr);
125
140
typedef
void (*
GhosttyAllocatorFreeFn
)(
void
*ctx,
void
*memory,
size_t
memory_len, uint8_t alignment, uintptr_t ret_addr);
141
173
typedef
struct
{
175
GhosttyAllocatorAllocFn
alloc
;
176
178
GhosttyAllocatorResizeFn
resize
;
179
181
GhosttyAllocatorRemapFn
remap
;
182
184
GhosttyAllocatorFreeFn
free
;
185
197
void
*
reserved
[4];
198
}
GhosttyAllocatorVtable
;
199
210
typedef
struct
GhosttyAllocator
{
215
void
*
ctx
;
216
220
const
GhosttyAllocatorVtable
*
vtable
;
221
}
GhosttyAllocator
;
222
237
GHOSTTY_API uint8_t*
ghostty_alloc
(
const
GhosttyAllocator
* allocator,
size_t
len);
238
259
GHOSTTY_API
void
ghostty_free
(
const
GhosttyAllocator
* allocator, uint8_t* ptr,
size_t
len);
260
262
263
#endif
/* GHOSTTY_VT_ALLOCATOR_H */
GhosttyAllocatorResizeFn
bool(* GhosttyAllocatorResizeFn)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, size_t new_len, uintptr_t ret_addr)
Definition
allocator.h:99
GhosttyAllocatorRemapFn
void *(* GhosttyAllocatorRemapFn)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, size_t new_len, uintptr_t ret_addr)
Definition
allocator.h:124
ghostty_alloc
GHOSTTY_API uint8_t * ghostty_alloc(const GhosttyAllocator *allocator, size_t len)
ghostty_free
GHOSTTY_API void ghostty_free(const GhosttyAllocator *allocator, uint8_t *ptr, size_t len)
GhosttyAllocatorAllocFn
void *(* GhosttyAllocatorAllocFn)(void *ctx, size_t len, uint8_t alignment, uintptr_t ret_addr)
Definition
allocator.h:50
GhosttyAllocatorFreeFn
void(* GhosttyAllocatorFreeFn)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, uintptr_t ret_addr)
Definition
allocator.h:140
GhosttyAllocatorVtable
Definition
allocator.h:173
GhosttyAllocatorVtable::free
GhosttyAllocatorFreeFn free
Definition
allocator.h:184
GhosttyAllocatorVtable::reserved
void * reserved[4]
Definition
allocator.h:197
GhosttyAllocatorVtable::remap
GhosttyAllocatorRemapFn remap
Definition
allocator.h:181
GhosttyAllocatorVtable::alloc
GhosttyAllocatorAllocFn alloc
Definition
allocator.h:175
GhosttyAllocatorVtable::resize
GhosttyAllocatorResizeFn resize
Definition
allocator.h:178
GhosttyAllocator
Definition
allocator.h:210
GhosttyAllocator::ctx
void * ctx
Definition
allocator.h:215
GhosttyAllocator::vtable
const GhosttyAllocatorVtable * vtable
Definition
allocator.h:220
types.h
include
ghostty
vt
allocator.h
Generated by
1.17.0