treeSitterSetAllocator function

void treeSitterSetAllocator({
  1. TreeSitterMallocFunction? malloc,
  2. TreeSitterCallocFunction? calloc,
  3. TreeSitterReallocFunction? realloc,
  4. TreeSitterFreeFunction? free,
})

Installs Tree-sitter allocation callbacks, resetting every null slot to its default just like ts_set_allocator.

This is an observable pure-Dart callback boundary. It does not and cannot redirect allocations performed internally by the Dart VM.

Implementation

void treeSitterSetAllocator({
  TreeSitterMallocFunction? malloc,
  TreeSitterCallocFunction? calloc,
  TreeSitterReallocFunction? realloc,
  TreeSitterFreeFunction? free,
}) {
  treeSitterAllocator._set(
    malloc: malloc,
    calloc: calloc,
    realloc: realloc,
    free: free,
  );
}