

memory allocation     Technical Information     memory allocation




The following diagram shows how COHERENT allocates memory.























































COHERENT Lexicon                                           Page 1




memory allocation     Technical Information     memory allocation



Data Segment (maximum size 64 kilobytes)



        ZDDDDDDDDDDDDDDDDDDDDDDD?
        |                       |
        |       ARENA AND       |
        |      FREE MEMORY      |
        |                       |
        CDDDDDDDDDDDDDDDDDDDDDDD4 ^ SP starts here
        |                       |
        |        STACK          |
        |                       |
        CDDDDDDDDDDDDDDDDDDDDDDD4
        |                       |
        |    UNITIALIZED DATA   |
        |         (bssi)        |
        |                       |
        CDDDDDDDDDDDDDDDDDDDDDDD4
        |                       |
        |  PRIVATE DATA (prvd)  |
        |                       |
        CDDDDDDDDDDDDDDDDDDDDDDD4
        |                       |
        |   SHARED DATA (shrd)  |
        |                       |
        @DDDDDDDDDDDDDDDDDDDDDDDY ^ DS ES SS point here



Code Segment (maximum size 64 kilobytes)

        ZDDDDDDDDDDDDDDDDDDDDDDD?
        |                       |
        |          CODE         |
        |                       |
        CDDDDDDDDDDDDDDDDDDDDDDD4
        |                       |
        |    RUNTIME STARTUP    |
        |                       |
        @DDDDDDDDDDDDDDDDDDDDDDDY ^ CS points here


Note that COHERENT can relocate the code and data segments at its
own convience and merely repoint the required segment registers.

The stack  _d_e_s_c_e_n_d_s from the highest address  in its space toward
the static  data area; new  arguments are placed on  the stack in
its lowest  address.  Everything from the top  of the stack space
to  the end  of the  data segment is  free to  accept dynamically
allocated data.

The size of  the stack cannot be altered while  a program is run-
ning.  By default, the runtime startup sets the stack size to two
kilobytes (2,048  bytes) Note,  however, that a  highly recursive


COHERENT Lexicon                                           Page 2




memory allocation     Technical Information     memory allocation



function may cause the stack to grow larger than two kilobytes so
that  it  overwrites  other data  areas.   This  will cause  your
program  to  work  incorrectly.  To  reset  the  amount of  stack
allocated to a program, use the command fixstack.

***** See Also *****

data formats, fixstack, technical information

















































COHERENT Lexicon                                           Page 3


