EasyManuals Logo
Home>Texas Instruments>Calculator>TI-89

Texas Instruments TI-89 Developer's Guide

Texas Instruments TI-89
1398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #890 background imageLoading...
Page #890 background image
848
Appendix A: System Routines — Memory Management
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
HeapAllocThrow
Declaration:
HANDLE
HeapAllocThrow
(DWORD
Hlen
)
Category(ies):
Memory Management
Description:
Allocate a block of heap memory of the given size and return its handle
throwing a ER_MEMORY error if there is not enough memory (compared
with
HeapAlloc
which returns H_NULL if there is not enough memory).
Use
HeapDeref
to dereference the handle and get a pointer to the actual
memory. Note that a pointer to the heap is valid only as long as heap
compression is not done.
Inputs:
Hlen
Length of block of memory to allocate (all odd sizes are rounded
up to be even).
Outputs:
HANDLE of memory block allocated, throws an ER_MEMORY error if not
enough memory (
HeapAlloc
just returns H_NULL in that case).
Assumptions:
Hlen
may not exceed 65520 bytes and the minimum block size is eight
bytes.
Side Effects:
May cause heap compression.
This routine may throw an ER_MEMORY error.
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: HeapAlloc, HeapFree, HeapFreeIndir
Example:
HANDLE hBlock1=0, hBlock2=0; /* set to 0 for HeapFreeIndir */
TRY
hBlock1 = HeapAllocThrow( 1000 );
hBlock2 = HeapAllocThrow( 2000 );
/* . . . use hBlock1, hBlock2, hBlock 3 . . . */
HeapFreeIndir( &hBlock1 );
HeapFreeIndir( &hBlock2 );
ONERR
/* Free memory we may have allocated, Note: HeapFreeIndir checks * HANDLE first */
HeapFreeIndir( &hBlock1 );
HeapFreeIndir( &hBlock1 );
PASS; /* pass error on up */
ENDTRY
}

Table of Contents

Other manuals for Texas Instruments TI-89

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TI-89 and is the answer not in the manual?

Texas Instruments TI-89 Specifications

General IconGeneral
Display size (HxV)100 x 160 mm
Memory type639K FLASH ROM, 188K bytes RAM
Compatible operating systemsOperating System 2.09
Battery typeAAA

Related product manuals