Name

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

Usage

// Allocator API
SPVM_ENV_ALLOCATOR* allocator_api = env->api->allocator;

// New allocator
void* allocator = allocator_api->new_instance();

// Free allocator
allocator_api->free_instance(allocator);

Description

SPVM Allocator Native APIs are the APIs to allocate and free memories.

IDs of Allocator Native APIs

Allocator native APIs have its IDs.

0 new_instance
1 free_instance

Allocator Native APIs

new_instance

void* (*new_instance)(void);

Creates a new allocator object.

free_instance

void (*free_instance)(void* allocator);

Frees an allocator object.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License