GTGMemory.h
Go to the documentation of this file.
#ifndef GTG_MEMORY_H
#define GTG_MEMORY_H
#include <stdlib.h>
struct gtg_memory {
void *first_mem;
void *current_mem;
size_t block_len;
long mem_len;
void *first_free;
long first_new;
long nb_allocated;
};
typedef struct gtg_memory *gtg_memory_t;
void gtg_block_memory_init(gtg_memory_t *memory, size_t block_size, long initial_block_number);
void* gtg_block_malloc(gtg_memory_t memory);
void gtg_block_free(gtg_memory_t memory, void *ptr);
#endif
gtg_memory_t
struct gtg_memory * gtg_memory_t
Definition GTGMemory.h:28
gtg_block_malloc
void * gtg_block_malloc(gtg_memory_t memory)
Allocate a block of data.
gtg_block_memory_init
void gtg_block_memory_init(gtg_memory_t *memory, size_t block_size, long initial_block_number)
Initialize the allocator.
gtg_block_free
void gtg_block_free(gtg_memory_t memory, void *ptr)
Free a block of data.
gtg_memory
Definition GTGMemory.h:19
gtg_memory::nb_allocated
long nb_allocated
Definition GTGMemory.h:26
gtg_memory::current_mem
void * current_mem
Definition GTGMemory.h:21
gtg_memory::mem_len
long mem_len
Definition GTGMemory.h:23
gtg_memory::first_mem
void * first_mem
Definition GTGMemory.h:20
gtg_memory::block_len
size_t block_len
Definition GTGMemory.h:22
gtg_memory::first_new
long first_new
Definition GTGMemory.h:25
gtg_memory::first_free
void * first_free
Definition GTGMemory.h:24