libghostty-vt
0.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
67
typedef
struct
{
81
void
* (*alloc)(
void
*ctx,
size_t
len, uint8_t alignment, uintptr_t ret_addr);
82
101
bool (*
resize
)(
void
*ctx,
void
*memory,
size_t
memory_len, uint8_t alignment,
size_t
new_len, uintptr_t ret_addr);
102
125
void
* (*remap)(
void
*ctx,
void
*memory,
size_t
memory_len, uint8_t alignment,
size_t
new_len, uintptr_t ret_addr);
126
138
void (*
free
)(
void
*ctx,
void
*memory,
size_t
memory_len, uint8_t alignment, uintptr_t ret_addr);
139
151
void
*
reserved
[4];
152
}
GhosttyAllocatorVtable
;
153
164
typedef
struct
GhosttyAllocator
{
169
void
*
ctx
;
170
174
const
GhosttyAllocatorVtable
*
vtable
;
175
}
GhosttyAllocator
;
176
191
GHOSTTY_API uint8_t*
ghostty_alloc
(
const
GhosttyAllocator
* allocator,
size_t
len);
192
213
GHOSTTY_API
void
ghostty_free
(
const
GhosttyAllocator
* allocator, uint8_t* ptr,
size_t
len);
214
216
217
#endif
/* GHOSTTY_VT_ALLOCATOR_H */
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)
GhosttyAllocator
Definition
allocator.h:164
GhosttyAllocator::ctx
void * ctx
Definition
allocator.h:169
GhosttyAllocator::vtable
const GhosttyAllocatorVtable * vtable
Definition
allocator.h:174
GhosttyAllocatorVtable
Definition
allocator.h:67
GhosttyAllocatorVtable::resize
bool(* resize)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, size_t new_len, uintptr_t ret_addr)
Definition
allocator.h:101
GhosttyAllocatorVtable::free
void(* free)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, uintptr_t ret_addr)
Definition
allocator.h:138
GhosttyAllocatorVtable::reserved
void * reserved[4]
Definition
allocator.h:151
types.h
include
ghostty
vt
allocator.h
Generated by
1.17.0