gwenhywfar
4.3.3
|
#include "memory_p.h"
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/types.h>
#include <gwenhywfar/stringlist.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
Go to the source code of this file.
Functions | |
unsigned char * | GWEN_Memory__FindFreeBlock (unsigned short dsize) |
void * | GWEN_Memory__Malloc (unsigned short dsize) |
void | GWEN_Memory_Collect (void) |
void | GWEN_Memory_dealloc (void *p) |
void | GWEN_Memory_Dump (void) |
void * | GWEN_Memory_malloc (size_t wsize) |
int | GWEN_Memory_ModuleFini (void) |
int | GWEN_Memory_ModuleInit (void) |
void * | GWEN_Memory_realloc (void *oldp, size_t nsize) |
void | GWEN_Memory_Report (void) |
char * | GWEN_Memory_strdup (const char *s) |
void | GWEN_Memory_Table__Collect (GWEN_MEMORY_TABLE *mt) |
void | GWEN_Memory_Table__CollectAt (GWEN_MEMORY_TABLE *mt, unsigned char *p) |
void | GWEN_Memory_Table__Dump (GWEN_MEMORY_TABLE *mt) |
unsigned char * | GWEN_Memory_Table__FindFreeBlock (GWEN_MEMORY_TABLE *mt, unsigned short dsize) |
void | GWEN_Memory_Table_Append (GWEN_MEMORY_TABLE *head, GWEN_MEMORY_TABLE *mt) |
void | GWEN_Memory_Table_free (GWEN_MEMORY_TABLE *mt) |
void | GWEN_Memory_Table_Insert (GWEN_MEMORY_TABLE *mt) |
GWEN_MEMORY_TABLE * | GWEN_Memory_Table_new (void) |
Variables | |
static size_t | gwen_memory__allocated_bytes = 0 |
static size_t | gwen_memory__allocated_calls = 0 |
static size_t | gwen_memory__allocated_reused = 0 |
static int | gwen_memory__debug = 0 |
static GWEN_MEMORY_TABLE * | gwen_memory__first_table = 0 |
static int | gwen_memory__nofree = 0 |
static int | gwen_memory__verbous = 0 |
unsigned char* GWEN_Memory__FindFreeBlock | ( | unsigned short | dsize | ) |
Definition at line 316 of file memory.c.
References gwen_memory__first_table, GWEN_Memory_Table__FindFreeBlock(), GWEN_Memory_Table_Insert(), and GWEN_Memory_Table_new().
Referenced by GWEN_Memory__Malloc().
void* GWEN_Memory__Malloc | ( | unsigned short | dsize | ) |
Definition at line 349 of file memory.c.
References gwen_memory__allocated_reused, and GWEN_Memory__FindFreeBlock().
Referenced by GWEN_Memory_malloc().
void GWEN_Memory_Collect | ( | void | ) |
Definition at line 559 of file memory.c.
References gwen_memory__first_table, and GWEN_Memory_Table__Collect().
Referenced by GWEN_Memory_dealloc().
void GWEN_Memory_dealloc | ( | void * | p | ) |
Definition at line 468 of file memory.c.
References GWEN_LIKELY, gwen_memory__nofree, and GWEN_Memory_Collect().
Referenced by GWEN_Buffer_free(), GWEN_DB_Dump(), GWEN_DB_GroupRename(), GWEN_DB_Node_free(), GWEN_DB_SetCharValueInNode(), GWEN_DB_VariableRename(), GWEN_DB_WriteGroupToIoLayer(), GWEN_Memory_realloc(), GWEN_XMLNode__CheckNameSpaceDecls1(), GWEN_XMLNode__SetProperty(), GWEN_XMLNode_CopyProperties(), GWEN_XMLNode_free(), GWEN_XMLNode_SetData(), GWEN_XMLNode_SetNamespace(), and GWEN_XMLProperty_free().
void GWEN_Memory_Dump | ( | void | ) |
Definition at line 547 of file memory.c.
References gwen_memory__first_table, and GWEN_Memory_Table__Dump().
void* GWEN_Memory_malloc | ( | size_t | wsize | ) |
Definition at line 385 of file memory.c.
References gwen_memory__allocated_bytes, gwen_memory__allocated_calls, GWEN_Memory__Malloc(), gwen_memory__verbous, and GWEN_UNLIKELY.
Referenced by GWEN_Buffer_AllocRoom(), GWEN_Buffer_dup(), GWEN_Buffer_new(), GWEN_DB_Dump(), GWEN_DB_ValueBin_new(), GWEN_DB_WriteGroupToIoLayer(), GWEN_Memory_realloc(), GWEN_Memory_strdup(), and GWEN_XMLNode_StripNamespaces().
int GWEN_Memory_ModuleFini | ( | void | ) |
Definition at line 79 of file memory.c.
References gwen_memory__allocated_bytes, gwen_memory__allocated_calls, gwen_memory__allocated_reused, gwen_memory__first_table, gwen_memory__verbous, and GWEN_Memory_Table_free().
Referenced by GWEN_Fini().
int GWEN_Memory_ModuleInit | ( | void | ) |
Definition at line 64 of file memory.c.
References gwen_memory__debug, gwen_memory__nofree, and gwen_memory__verbous.
Referenced by GWEN_Init().
void* GWEN_Memory_realloc | ( | void * | oldp, |
size_t | nsize | ||
) |
Definition at line 431 of file memory.c.
References GWEN_Memory_dealloc(), and GWEN_Memory_malloc().
Referenced by GWEN_Buffer_AllocRoom().
void GWEN_Memory_Report | ( | void | ) |
char* GWEN_Memory_strdup | ( | const char * | s | ) |
Definition at line 526 of file memory.c.
References GWEN_Memory_malloc().
Referenced by GWEN_DB_Group_new(), GWEN_DB_GroupRename(), GWEN_DB_SetCharValueInNode(), GWEN_DB_ValueChar_new(), GWEN_DB_Var_new(), GWEN_DB_VariableRename(), GWEN_XMLNode__CheckNameSpaceDecls1(), GWEN_XMLNode__SetProperty(), GWEN_XMLNode_CopyProperties(), GWEN_XMLNode_NameSpace_new(), GWEN_XMLNode_new(), GWEN_XMLNode_SetData(), GWEN_XMLNode_SetNamespace(), GWEN_XMLNode_StripNamespaces(), and GWEN_XMLProperty_new().
void GWEN_Memory_Table__Collect | ( | GWEN_MEMORY_TABLE * | mt | ) |
Definition at line 273 of file memory.c.
References GWEN_Memory_Table__CollectAt().
Referenced by GWEN_Memory_Collect().
void GWEN_Memory_Table__CollectAt | ( | GWEN_MEMORY_TABLE * | mt, |
unsigned char * | p | ||
) |
Definition at line 235 of file memory.c.
Referenced by GWEN_Memory_Table__Collect().
void GWEN_Memory_Table__Dump | ( | GWEN_MEMORY_TABLE * | mt | ) |
Definition at line 292 of file memory.c.
Referenced by GWEN_Memory_Dump().
unsigned char* GWEN_Memory_Table__FindFreeBlock | ( | GWEN_MEMORY_TABLE * | mt, |
unsigned short | dsize | ||
) |
Definition at line 203 of file memory.c.
Referenced by GWEN_Memory__FindFreeBlock().
void GWEN_Memory_Table_Append | ( | GWEN_MEMORY_TABLE * | head, |
GWEN_MEMORY_TABLE * | mt | ||
) |
void GWEN_Memory_Table_free | ( | GWEN_MEMORY_TABLE * | mt | ) |
Definition at line 153 of file memory.c.
References gwen_memory__debug.
Referenced by GWEN_Memory_ModuleFini().
void GWEN_Memory_Table_Insert | ( | GWEN_MEMORY_TABLE * | mt | ) |
Definition at line 196 of file memory.c.
References gwen_memory__first_table.
Referenced by GWEN_Memory__FindFreeBlock().
GWEN_MEMORY_TABLE* GWEN_Memory_Table_new | ( | void | ) |
Definition at line 134 of file memory.c.
References gwen_memory__verbous.
Referenced by GWEN_Memory__FindFreeBlock().
size_t gwen_memory__allocated_bytes = 0 [static] |
Definition at line 54 of file memory.c.
Referenced by GWEN_Memory_malloc(), and GWEN_Memory_ModuleFini().
size_t gwen_memory__allocated_calls = 0 [static] |
Definition at line 55 of file memory.c.
Referenced by GWEN_Memory_malloc(), and GWEN_Memory_ModuleFini().
size_t gwen_memory__allocated_reused = 0 [static] |
Definition at line 56 of file memory.c.
Referenced by GWEN_Memory__Malloc(), and GWEN_Memory_ModuleFini().
int gwen_memory__debug = 0 [static] |
Definition at line 51 of file memory.c.
Referenced by GWEN_Memory_ModuleInit(), and GWEN_Memory_Table_free().
GWEN_MEMORY_TABLE* gwen_memory__first_table = 0 [static] |
Definition at line 50 of file memory.c.
Referenced by GWEN_Memory__FindFreeBlock(), GWEN_Memory_Collect(), GWEN_Memory_Dump(), GWEN_Memory_ModuleFini(), and GWEN_Memory_Table_Insert().
int gwen_memory__nofree = 0 [static] |
Definition at line 52 of file memory.c.
Referenced by GWEN_Memory_dealloc(), and GWEN_Memory_ModuleInit().
int gwen_memory__verbous = 0 [static] |
Definition at line 53 of file memory.c.
Referenced by GWEN_Memory_malloc(), GWEN_Memory_ModuleFini(), GWEN_Memory_ModuleInit(), and GWEN_Memory_Table_new().