r3rememb

r3rememb

Class

real/support/r3rememb.h

Library

r3support

Description:

Memory managment class. Allocats large chunk of memory from which smaller chunks can be fetched quickly. All the allocated memory can be freed in one call very efficiently.

See Also

oops/r3root.h

Super Class

r3Root

R3CLID_ROOT

JavaScript

r3Remember

Class Identifier

R3CLID_REMEMBER - 300

Methods

ALLOC, FREE,

Attributes

Avail, Size, Limit, Total, TotalUsed, MemKey,

Registration

int R3RegisterRememberClass(R3APP *app);

R3REMM_ALLOC

Method

ALLOC

Identifier

R3REMM_ALLOC

Return

void*, allocated memory or NULL if failed

Param 1:

R3INT, size of memory to be allocated

Param 3:

R3INT, flags (R3MEMF_CLEAR).

JavaScript

rc = obj.ALLOC(p1, p3);

Description

Allocate memory

R3REMM_FREE

Method

FREE

Identifier

R3REMM_FREE

JavaScript

obj.FREE();

Description

Free all the memory

Avail

Attribute

Avail

Identifier

R3REMA_Avail

JavaScript type

Integer

C type

R3INT

Description

avail mem

Syntax


value = jsobj.GetAvail();


R3INT value;
R3GetAttrs(r3obj, R3REMA_Avail, &value, R3TAG_END);

Size

Attribute

Size

Identifier

R3REMA_Size

JavaScript type

Integer

C type

R3INT

Description

pool size

Syntax


jsobj.SetSize(value);
value = jsobj.GetSize();


R3INT value = ...;
R3SetAttrs(r3obj, R3REMA_Size, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3REMA_Size, &value, R3TAG_END);

Limit

Attribute

Limit

Identifier

R3REMA_Limit

JavaScript type

Integer

C type

R3INT

Description

limit for single allocs

Syntax


jsobj.SetLimit(value);
value = jsobj.GetLimit();


R3INT value = ...;
R3SetAttrs(r3obj, R3REMA_Limit, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3REMA_Limit, &value, R3TAG_END);

Total

Attribute

Total

Identifier

R3REMA_Total

JavaScript type

Integer

C type

R3INT

Description

total memory allocated via this key

Syntax


jsobj.SetTotal(value);
value = jsobj.GetTotal();


R3INT value = ...;
R3SetAttrs(r3obj, R3REMA_Total, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3REMA_Total, &value, R3TAG_END);

TotalUsed

Attribute

TotalUsed

Identifier

R3REMA_TotalUsed

JavaScript type

Integer

C type

int*

Description

pointer to int

Syntax


value = jsobj.GetTotalUsed();


int* value;
R3GetAttrs(r3obj, R3REMA_TotalUsed, &value, R3TAG_END);

MemKey

Attribute

MemKey

Identifier

R3REMA_MemKey

JavaScript type

String

C type

void*

Description

key which can be passed to actual alloc

Syntax


value = jsobj.GetMemKey();


void* value;
R3GetAttrs(r3obj, R3REMA_MemKey, &value, R3TAG_END);

Use these handy macros


r3appobj *