git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4515 4a8a32a2...
[fw/sdcc] / doc / sdccman.lyx
index 5ba1663d11a1f49c5dfc3fb77e3658d9adc0abd1..c4ce3eba5665fbec3744787ae389bbd7b950254f 100644 (file)
@@ -10658,7 +10658,7 @@ portmode
 
 \end_inset 
 
-=z180 (z80) is used to turn on (off) the Z180/HD64180 port addressing instructio
+ z180 (z80) is used to turn on (off) the Z180/HD64180 port addressing instructio
 ns 
 \family typewriter 
 in0/out0
@@ -16056,88 +16056,35 @@ not
 
 \layout Standard
 
-Before using dynamic memory allocation
+As of SDCC 2.6.2 you no longer need to call an initialization routine before
+ using dynamic memory allocation
 \begin_inset LatexCommand \index{dynamic memory allocation (malloc)}
 
 \end_inset 
 
with SDCC, you have to provide heap
and a default heap
 \begin_inset LatexCommand \index{heap (malloc)}
 
 \end_inset 
 
- space for malloc to allocate memory from
-\family typewriter 
-.
+ space of 1024 bytes is provided for malloc to allocate memory from.
  
 \family default 
-You can acomplish this by including the following code into your source:
+If you need a different heap size you need to recompile _heap.c with the
+ required size defined in HEAP_SIZE. It is recommended to make a copy of this
+ file into your project directory and compile it there with:
 \layout Verse
 
 
 \family typewriter 
-#include <malloc.h>
-\begin_inset LatexCommand \index{malloc.h}
-
-\end_inset 
-
- /* calloc
-\begin_inset LatexCommand \index{calloc}
-
-\end_inset 
-
-, malloc
-\begin_inset LatexCommand \index{malloc}
-
-\end_inset 
-
-, realloc
-\begin_inset LatexCommand \index{realloc}
-
-\end_inset 
-
-, and free
-\begin_inset LatexCommand \index{free (malloc)}
-
-\end_inset 
-
- */ 
-\newline 
-
-\newline 
-#define HEAPSIZE 0x1000 /* Adjust depending on available memory */ 
-\newline 
-unsigned char xdata myheap[HEAPSIZE]; /* The actual heap for dynamic memory
- */ 
+sdcc -c _heap.c -D HEAD_SIZE=2048
 \newline 
+\family default 
+And then link it with:
+\layout Verse
 
-\newline 
-void main (void) 
-\newline 
-{ 
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-/* Your variable declarations come here*/
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-...
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-init_dynamic_memory((MEMHEADER xdata *)myheap, HEAPSIZE);
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-...
- /* Rest of your code*/
-\newline 
-} 
+\family typewriter 
+sdcc main.rel _heap.rel
 \newline 
 
 \layout Subsection
@@ -19257,17 +19204,6 @@ If the stack_size field is omitted then a stack is created with the default
 \layout List
 \labelwidthstring 00.00.0000
 
-wparam 
-\emph on 
-This pragma is deprecated.
- Its use will cause a warning message to be issued.
-\emph default 
-
-\newline 
-
-\layout List
-\labelwidthstring 00.00.0000
-
 code
 \begin_inset LatexCommand \index{PIC16!Pragmas!\#pragma code}
 
@@ -20092,9 +20028,6 @@ void func_wparam(int a) wparam
 \layout LyX-Code
 
 }
-\layout Standard
-
-This keyword replaces the deprecated wparam pragma.
 \layout List
 \labelwidthstring 00.00.0000