3.3.2 Interpreter Internal Debugging Functions

ALLOCATED([option])

Returns the amount of dynamic storage allocated, measured in
bytes.  This is the memory allocated by the malloc() call, and
does not concern stack space or static variables.

As parameter it may take an option, which is one of the single
characters:

[A]
     This is the default value if you do not specify an option. It
     will return a string that is the number of bytes of dynamic
     memory currently allocated by the interpreter.

[C]
     Returns a number that is the number of bytes of dynamic
     memory that is currently in use (i.e. not leaked).

[L]
     Returns the number of bytes of dynamic memory that is
     supposed to have been leaked.

[S]
     Returns a string that is nicely formatted and contains all
     the other three options, with labels. The format of this
     string is:

      “Memory: Allocated=XXX, Current=YYY, Leaked=ZZZ”.

This function will only be available if the interpreter was
compiled with the TRACEMEM preprocessor macro defined.


DUMPTREE()

Prints out the internal parse tree for the REXX program currently
being executed. This output is not very interesting unless you
have good knowledge of the interpreter’s internal structures.


DUMPVARS()

This routine dumps a list of all the variables currently defined.
It also gives a lot of information which is rather uninteresting
for most users.


LISTLEAKED()

List out all memory that has leaked from the interpreter. As a
return value, the total memory that has been listed is returned.
There are several option to this function:

[N]
     Do not list anything, just calculate the memory.

[A]
     List all memory allocations currently in use, not only that
     which has been marked as leaked.

[L]
     Only list the memory that has been marked as leaked. This is
     the default option.


TRACEBACK()

Prints out a traceback. This is the same routine which is called
when the interpreter encounters an error. Nice for debugging, but
not really useful for any other purposes.



PREV NEXT