ghostty_alloc function

  1. @Native<Pointer<Uint8> Function(Pointer<GhosttyAllocator>, Size)>(ffi.Pointer<GhosttyAllocator>, ffi.Size)>()
Pointer<Uint8> ghostty_alloc(
  1. Pointer<GhosttyAllocator> allocator,
  2. int len
)

Allocate a buffer of len bytes.

Uses the provided allocator, or the default allocator if NULL is passed. The returned buffer must be freed with ghostty_free() using the same allocator.

@param allocator Pointer to the allocator to use, or NULL for the default @param len Number of bytes to allocate @return Pointer to the allocated buffer, or NULL if allocation failed

@ingroup allocator

Implementation

@ffi.Native<
  ffi.Pointer<ffi.Uint8> Function(ffi.Pointer<GhosttyAllocator>, ffi.Size)
>()
external ffi.Pointer<ffi.Uint8> ghostty_alloc(
  ffi.Pointer<GhosttyAllocator> allocator,
  int len,
);