| 1 | =head1 Name | ||
| 2 | |||
| 3 | SPVM::Document::NativeAPI::Allocator - Allocator Native APIs | ||
| 4 | |||
| 5 | =head1 Description | ||
| 6 | |||
| 7 | The allocator native APIs in L<SPVM> are the APIs for memory allocators. | ||
| 8 | |||
| 9 | =head1 Usage | ||
| 10 | |||
| 11 | SPVM_API_ALLOCATOR* api_allocator = env->api->allocator; | ||
| 12 | |||
| 13 | SPVM_NATIVE_ALLOCATOR* allocator = api_allocator->new_instance(); | ||
| 14 | |||
| 15 | api_allocator->free_instance(allocator); | ||
| 16 | |||
| 17 | =head1 Native APIs | ||
| 18 | |||
| 19 | =head2 new_instance | ||
| 20 | |||
| 21 | C<SPVM_NATIVE_ALLOCATOR* (*new_instance)(void);> | ||
| 22 | |||
| 23 | Creates a new L<memory allocator|SPVM::Document::NativeAPI::Allocator> and returns it. | ||
| 24 | |||
| 25 | =head2 free_instance | ||
| 26 | |||
| 27 | C<void (*free_instance)(L<SPVM_NATIVE_ALLOCATOR* allocator|SPVM::Document::NativeAPI::Allocator>);> | ||
| 28 | |||
| 29 | Frees the L<memory allocator|SPVM::Document::NativeAPI::Allocator> I<allocator>. | ||
| 30 | |||
| 31 | =head1 Native API IDs | ||
| 32 | |||
| 33 | 0 new_instance | ||
| 34 | 1 free_instance | ||
| 35 | |||
| 36 | =head1 See Also | ||
| 37 | |||
| 38 | =over 2 | ||
| 39 | |||
| 40 | =item * L<SPVM::Document::NativeAPI> | ||
| 41 | |||
| 42 | =item * L<SPVM::Document::NativeAPI::StringBuffer> | ||
| 43 | |||
| 44 | =item * L<SPVM::Document::NativeClass> | ||
| 45 | |||
| 46 | =item * L<SPVM::Document> | ||
| 47 | |||
| 48 | =back | ||
| 49 | |||
| 50 | =head1 Copyright & License | ||
| 51 | |||
| 52 | Copyright (c) 2023 Yuki Kimoto | ||
| 53 | |||
| 54 | MIT License |