Coconut Framework  beta
Macros | Functions
CNResource.h File Reference

Define CNResource data structure. More...

#include "CNMemoryProfile.h"
#include <stdlib.h>

Go to the source code of this file.

Macros

#define CNUnitSizeOfResource   32
 

Functions

struct CNResource * CNAllocateResource (void)
 Allocate CNResource object. More...
 
void CNFreeResource (struct CNResource *resource)
 Deallocate all memory object in the source resource. More...
 
void * CNAllocateData (struct CNResource *resource, size_t size)
 Allocate data memory. More...
 
void CNReleaseData (struct CNResource *resource, size_t size, void *src)
 Release memory object into resource. More...
 
void CNProfileOfResource (struct CNMemoryProfile *dst, const struct CNResource *resource)
 Get memory profile of resource. More...
 

Detailed Description

Define CNResource data structure.

Copyright
Copyright (C) 2012 Steel Wheels Project

Macro Definition Documentation

#define CNUnitSizeOfResource   32

Unit memory allocation size

Function Documentation

struct CNResource* CNAllocateResource ( void  )

Allocate CNResource object.

Returns
Allocated object
void CNFreeResource ( struct CNResource *  resource)

Deallocate all memory object in the source resource.

Parameters
resourceDestination resource to be deallocated
void* CNAllocateData ( struct CNResource *  resource,
size_t  size 
)

Allocate data memory.

Returns
Allocated memory object
Parameters
resourceResource to allocate the object
sizeRequired size

Referenced by CNAllocateListItem(), and CNAllocateObject().

void CNReleaseData ( struct CNResource *  resource,
size_t  size,
void *  src 
)

Release memory object into resource.

Parameters
resourceDestination resource
sizeSize of released memory object
srcSource memory object

Referenced by CNReleaseListItem().

void CNProfileOfResource ( struct CNMemoryProfile dst,
const struct CNResource *  resource 
)

Get memory profile of resource.

Parameters
dstDestination profile
resourceSource resource