libghostty-vt 0.0.0
Loading...
Searching...
No Matches
GhosttyAllocator Struct Reference

#include <ghostty/vt/allocator.h>

Data Fields

void * ctx
const GhosttyAllocatorVtable * vtable

Detailed Description

A custom allocator: a vtable and the context it operates on.

Pass a pointer to one of these to any function that takes an allocator, or pass NULL to use the default allocator described in The Default Allocator. The library does not copy the allocator. It must stay valid for as long as anything allocated with it is in use.

Examples
c-vt-allocator/src/main.c, and c-vt-kitty-graphics/src/main.c.

Definition at line 164 of file allocator.h.

Field Documentation

◆ ctx

void* ctx

Your allocator's state, passed unchanged to every vtable function. May be NULL if your allocator has no state.

Definition at line 169 of file allocator.h.

◆ vtable

const GhosttyAllocatorVtable* vtable

The functions that implement this allocator. Must not be NULL.

Definition at line 174 of file allocator.h.


The documentation for this struct was generated from the following file: