Name

SPVM::Document::NativeAPI::Allocator - SPVM Allocator Native APIs

Synopsys

  // Allocator API
  void* allocator_api = env->api->allocator;
  
  // New allocator
  void* allocator = allocator_api->new_allocator();
  
  // Free allocator
  allocator_api->free_allocator(allocator);

Description

SPVM Allocator Native APIs are the public APIs to alloc/free memories.

Ids Of Allocator Native APIs

Allocator native APIs have its IDs.

  0 new_allocator
  1 free_allocator

Allocator Native APIs

new_allocator

  void* (*new_allocator)();

Create a new allocator object.

free_allocator

  void (*free_allocator)(void* allocator);

Free an allocator object.