SPVM::D...ngBuffer(3)
π NAME
Okay bestie, so this page is all about SPVM::Document::NativeAPI::StringBuffer β it's the String Buffer Native APIs, and yes it lives in the User Contributed Perl Documentation section (the manual page is SPVM::D...ngBuffer(3), iykyk). Basically: everything you need to know about the string buffer native APIs in SPVM. π
πΈ DESCRIPTION
The string buffer native APIs in SPVM are, literally, the APIs for string buffers. That's the whole vibe. π
β¨ USAGE
Here's the group-chat screenshot of how you actually use it, no cap:
SPVM_API_STRING_BUFFER* string_buffer_api = env->api->string_buffer;
SPVM_API_ALLOCATOR* api_allocator = env->api->allocator;
void* allocator = api_allocator->new_instance();
int32_t capacity = 100;
void* string_buffer = string_buffer_api->new_instance(allocator, capacity);
string_buffer_api->free_instance(string_buffer);
api_allocator->free_instance(allocator);
Like β grab the string buffer API, grab the allocator API, make an allocator, make a string buffer with it, then free both. Cleanup is self-care, periodt. π§
π₯ NATIVE APIS
β new_instance
void* (*new_instance)(void* allocator, int32_t capacity);
Creates a new string buffer given its capacity capacity, and returns it. It's giving main character energy β brand new buffer, just for you. π
β free_instance
void (*free_instance)(void* string_buffer);
Frees the string buffer string_buffer. Say bye bestie π«Ά (and like, actually free it, don't ghost your memory).
β get_string
const char* (*get_string)(void* string_buffer);
Returns the string stored in the string buffer string_buffer. The moment you've been waiting for: the string reveal. π
β get_length
int32_t (*get_length)(void* string_buffer);
Returns the length of the string stored in the string buffer string_buffer. Just the length, not the whole string β a lil sneak peek. π
π NATIVE API IDS
The IDs are numbered in this exact order, no shuffling:
0 new_instance
1 free_instance
2 get_string
3 get_length
π¦ SEE ALSO
SPVM::Document::NativeAPISPVM::Document::NativeAPI::AllocatorSPVM::Document::NativeClassSPVM::Document
Go read those too, they're the supporting cast and they ate. π
π COPYRIGHT & LICENSE
Copyright (c) 2023 Yuki Kimoto
MIT License
And that's the whole page, bestie β it's perl v5.42.2, dated 2026-02-03, and it says SPVM::D...ngBuffer(3) at the bottom, so you know it's official. Slay, mwah π
β¨
π¦ where this page comes from
- alpine 3.24: spvm-doc 0.990125-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms