vgl 1.0.0
Virtual Globe Library: API reference
Loading...
Searching...
No Matches
vgl_allocator_interface Struct Reference

#include <vgl/foundation.h>

Public Attributes

uint32_t version
 
uint32_t reserved
 
void * user_data
 
void *(* allocate )(void *user_data, size_t size, size_t alignment)
 
void(* deallocate )(void *user_data, void *memory, size_t size, size_t alignment)
 

Detailed Description

Host allocator. Every allocation made on behalf of a context goes through it (NFR-03). Must be thread-safe if a task callback is installed, or if the host completes I/O requests on threads other than the one that calls into the context.

Member Data Documentation

◆ version

uint32_t vgl_allocator_interface::version

VGL_ALLOCATOR_INTERFACE_VERSION

◆ reserved

uint32_t vgl_allocator_interface::reserved

◆ user_data

void* vgl_allocator_interface::user_data

◆ allocate

void *(* vgl_allocator_interface::allocate) (void *user_data, size_t size, size_t alignment)

Allocates size bytes aligned to alignment, a power of two. Returns null on failure. size is never 0.

Thread safety: any thread.

◆ deallocate

void(* vgl_allocator_interface::deallocate) (void *user_data, void *memory, size_t size, size_t alignment)

Frees memory returned by allocate, with the same size and alignment. memory is never null.

Thread safety: any thread.


The documentation for this struct was generated from the following file: