libghostty-vt 1.0.0
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
50typedef void* (*GhosttyAllocatorAllocFn)(void *ctx, size_t len, uint8_t alignment, uintptr_t ret_addr);
51
99typedef bool (*GhosttyAllocatorResizeFn)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, size_t new_len, uintptr_t ret_addr);
100
124typedef void* (*GhosttyAllocatorRemapFn)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, size_t new_len, uintptr_t ret_addr);
125
140typedef void (*GhosttyAllocatorFreeFn)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, uintptr_t ret_addr);
141
173typedef struct {
176
179
182
185
197 void* reserved[4];
199
210typedef struct GhosttyAllocator {
215 void *ctx;
216
222
237GHOSTTY_API uint8_t* ghostty_alloc(const GhosttyAllocator* allocator, size_t len);
238
259GHOSTTY_API void ghostty_free(const GhosttyAllocator* allocator, uint8_t* ptr, size_t len);
260
262
263#endif /* GHOSTTY_VT_ALLOCATOR_H */
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
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_API uint8_t * ghostty_alloc(const GhosttyAllocator *allocator, size_t len)
GHOSTTY_API void ghostty_free(const GhosttyAllocator *allocator, uint8_t *ptr, size_t len)
void *(* GhosttyAllocatorAllocFn)(void *ctx, size_t len, uint8_t alignment, uintptr_t ret_addr)
Definition allocator.h:50
void(* GhosttyAllocatorFreeFn)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, uintptr_t ret_addr)
Definition allocator.h:140
GhosttyAllocatorFreeFn free
Definition allocator.h:184
GhosttyAllocatorRemapFn remap
Definition allocator.h:181
GhosttyAllocatorAllocFn alloc
Definition allocator.h:175
GhosttyAllocatorResizeFn resize
Definition allocator.h:178
const GhosttyAllocatorVtable * vtable
Definition allocator.h:220