Memory - Argox PA-20 Programming Manual

Portable data terminal
Hide thumbs Also See for PA-20:
Table of Contents

Advertisement

Tfree
Purpose:
Use the Tfree to release an allocated storage block to the pool of free

memory.

Syntax:
void Tfree(void *mem_address);
Example call:
Tfree(buffer);
#include "SDK.h"
Includes:
Description:
The Tfree function returns to the pool of free memory a blockof memory
that was allocated earlier by Tmalloc. The address of the block is specified
by the argument mem_address, which is a pointer to the starting byte of the
block. A NULL pointer argument is ignored by Tfree.
Returns:
None
Tmalloc
Purpose:
Use Tmalloc to allocate memory for an array of a given number of bytes,
not exceeding 256KB.
Syntax:
void* Tmalloc(U32 num_bytes);
Example call:
buffer = (char *)Tmalloc(100*sizeof(char));
#include "SDK.h"
Includes:
Description:
The Tmalloc function allocates the number of bytes requested in the
argument num_bytes by calling internal Turbo C heap management
routines. The Tmalloc function will work properly for all memory models.
Returns:
The Tmalloc function returns a pointer that is the starting address of the
memory allocated. The allocated memory is properly aligned (the address
of the first byte meets the requirements for storing any type of C variable). If
the memory allocation is unsuccessful because of insufficient space or bad
values of the arguments, a NULL is returned.
Comments:
Note that when using Tmolloc to allocate storage for a specific data type,
you should cast the returned void pointer to that type.
TotalHeapSize
Purpose:
Checking the total heap size.
Syntax:
int TotalHeapSize(void);
Example call:
totalsize = TotalHeapSize();
#include "SDK.h "
Includes:
Description:
The TotalHeapSize function can get the total heap size.
Returns:
The total heap size in units of Kbytes.
UsedHeapSize
PT-20 Programming Guide
Memory
100

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pa-21Pa-2110Pa-2010

Table of Contents