mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-18 17:00:26 +02:00
* wip objects.c work * objects_disconnect_from_structure_bsp * match more functions * more objects work * objects_update work - 93.42% matching * match matrix4x3_transform_point * more objects work - fix duplicate symbol name at 1870800 * match object_choose_random_change_colors * match object_update * objects_garbage_collection work * match object_set_position * more object work * match objects_update * more object work * match object_select_random_region_permutations_by_variant * objects_in_sphere work 99.90% match * object name list calls * match objects_in_sphere * misc matches * match structure_bsp_definitions object * match objects_in_clusters_by_indices * more object work * match `edit_text_handle_key` * mark edit_text as matching * misc changes - match get_next_character - match data section in objects.c * object_export_function_values work * match object_compute_function_values * match object_get_orientation * added functions and adjust formatting * fix profile macros * formatting changes * more formatting * more formatting --------- Co-authored-by: punpckhdq <121350336+punpckhdq@users.noreply.github.com>
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
/*
|
|
MEMORY_POOL.H
|
|
|
|
header included in hcex build.
|
|
*/
|
|
|
|
#ifndef __MEMORY_POOL_H
|
|
#define __MEMORY_POOL_H
|
|
#pragma once
|
|
|
|
/* ---------- constants */
|
|
|
|
/* ---------- macros */
|
|
|
|
/* ---------- structures */
|
|
|
|
struct memory_pool_block
|
|
{
|
|
unsigned long header_signature;
|
|
long size;
|
|
void **reference;
|
|
struct memory_pool_block *next_block;
|
|
struct memory_pool_block *previous_block;
|
|
unsigned long trailer_signature;
|
|
};
|
|
|
|
struct memory_pool
|
|
{
|
|
unsigned long signature;
|
|
char name[32];
|
|
void *base_address;
|
|
long size;
|
|
long free_size;
|
|
struct memory_pool_block *first_block;
|
|
struct memory_pool_block *last_block;
|
|
};
|
|
|
|
/* ---------- prototypes/MEMORY_POOL.C */
|
|
|
|
struct memory_pool *memory_pool_new(char const *name, long size);
|
|
void memory_pool_delete(struct memory_pool *pool);
|
|
long memory_pool_allocation_size(long size);
|
|
void memory_pool_initialize(struct memory_pool *pool, char const *name, long size);
|
|
boolean memory_pool_block_allocate(struct memory_pool *pool, void **reference, long size);
|
|
boolean memory_pool_block_reallocate(struct memory_pool *pool, void **reference, long new_size);
|
|
void memory_pool_block_free(struct memory_pool *pool, void **reference);
|
|
void memory_pool_compact(struct memory_pool *pool);
|
|
long memory_pool_get_free_size(struct memory_pool *pool);
|
|
long memory_pool_get_used_size(struct memory_pool *pool);
|
|
long memory_pool_get_contiguous_free_size(struct memory_pool *pool);
|
|
|
|
/* ---------- globals */
|
|
|
|
/* ---------- public code */
|
|
|
|
#endif // __MEMORY_POOL_H
|