SW006014 Microchip Technology, SW006014 Datasheet - Page 196

C COMPILER MPLAB FOR PIC24 MCU

SW006014

Manufacturer Part Number
SW006014
Description
C COMPILER MPLAB FOR PIC24 MCU
Manufacturer
Microchip Technology
Type
MPLAB® C Compilerr
Series
PIC24r
Datasheet

Specifications of SW006014

Supported Families
PIC24
Core Architecture
PIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC24
Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC24
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
DS51456E-page 192
brk (Continued)
Default Behavior:
File:
close
Description:
Include:
Prototype:
Argument:
Return Value:
Remarks:
Default Behavior:
File:
If the argument endds is zero, the function sets the global variable
__curbrk to the address of the start of the heap, and returns zero.
If the argument endds is non-zero, and has a value less than the
address of the end of the heap, the function sets the global variable
__curbrk to the value of endds and returns zero.
Otherwise, the global variable __curbrk is unchanged, and the func-
tion returns -1.
The argument endds must be within the heap range (see data space
memory map below).
Notice that, since the stack is located immediately above the heap,
using brk() or sbrk() has little effect on the size of the dynamic
memory pool. The brk() and sbrk() functions are primarily intended
for use in run-time environments where the stack grows downward and
the heap grows upward.
The linker allocates a block of memory for the heap if the
-Wl,--heap=n option is specified, where n is the desired heap size in
characters. The starting and ending addresses of the heap are reported
in variables _heap and _eheap, respectively.
For the 16-bit compiler, using the linker's heap size option is the stan-
dard way of controlling heap size, rather than relying on brk() and
sbrk().
brk.c
Close a file.
None
int close(int handle);
handle
Returns ‘0’ if the file is successfully closed. A return value of ‘-1’ indi-
cates an error.
This helper function is called by the fclose() Standard C Library
function.
As distributed, this function passes the file handle to the simulator,
which issues a close in the host file system.
close.c
handle referring to an opened file
Variables
Stack
Heap
PSV
SFR
© 2008 Microchip Technology Inc.

Related parts for SW006014