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.


#define CNUnitSizeOfResource   32


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 (C) 2012 Steel Wheels Project

Macro Definition Documentation

#define CNUnitSizeOfResource   32

Unit memory allocation size

Function Documentation

struct CNResource* CNAllocateResource ( void  )

Allocate CNResource object.

Allocated object
void CNFreeResource ( struct CNResource *  resource)

Deallocate all memory object in the source resource.

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

Allocate data memory.

Allocated memory object
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.

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.

dstDestination profile
resourceSource resource