Name

SPVM::Document::NativeAPI::Internal - Internal Native APIs

Description

The internal native APIs in SPVM are the APIs for internal operations.

These APIs are used for the implementation of the SPVM language, so they should not be used.

Usage

SPVM_API_INTERNAL* api_internal = env->api->internal;

Native APIs

get_ref_count

int32_t (*get_ref_count)(SPVM_ENV* env, SPVM_VALUE* stack, void* object);

Returns the reference count of the object object.

inc_ref_count

void (*inc_ref_count)(SPVM_ENV* env, SPVM_VALUE* stack, void* object);

Increments the reference count of the object object.

dec_ref_count

void (*dec_ref_count)(SPVM_ENV* env, SPVM_VALUE* stack, void* object);

Decrements the reference count of the object object.

leave_scope_local

void (*leave_scope_local)(SPVM_ENV* env, SPVM_VALUE* stack, void** object_vars, int32_t* mortal_stack, int32_t* mortal_stack_top_ptr, int32_t original_mortal_stack_top);

Performs a leaveing scope operation for local variables given object variables object_vars, the mortal stack mortal_stack, the address of the top of the mortal stack mortal_stack_top_ptr, and the original top of the mortal stack original_mortal_stack_top.

The value referenced by mortal_stack_top_ptr is updated.

get_stack_tmp_buffer

char* (*get_stack_tmp_buffer)(SPVM_ENV* env, SPVM_VALUE* stack);

Returns the temporary buffer on the runtime stack stack.

The byte size of the temporary buffer is SPVM_NATIVE_C_STACK_TMP_BUFFER_SIZE.

Currently, this internal native API is the same as get_stack_tmp_buffer native API.

Native API IDs

0 get_ref_count
1 inc_ref_count
2 dec_ref_count
3 leave_scope_local
4 get_stack_tmp_buffer

See Also

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License