2 static char *RCSid
= "$Id$";
6 * The Regina Rexx Interpreter
7 * Copyright (C) 1992-1994 Anders Christensen <anders@pvv.unit.no>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public
20 * License along with this library; if not, write to the Free
21 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #ifdef REGINA_DEBUG_MEMORY
31 streng
*dbg_freelists( tsd_t
*TSD
, cparamboxptr dummy
)
34 return nullstringptr() ;
38 streng
*dbg_traceback( tsd_t
*TSD
, cparamboxptr dummy
)
41 dummy
= dummy
; /* keep compiler happy */
42 return nullstringptr() ;
48 streng
*dbg_dumpvars( tsd_t
*TSD
, cparamboxptr dummy
)
50 dumpvars(TSD
, (cvariableptr
*) TSD
->currlevel
->vars
) ;
51 dummy
= dummy
; /* keep compiler happy */
52 return nullstringptr() ;
57 streng
*dbg_memorystats( tsd_t
*TSD
, cparamboxptr parms
)
59 /* memory_stats(TSD) ; */ /* FIXME, FGC: Shouldn't memory_stats() deleted? */
60 return nullstringptr() ;
64 streng
*dbg_allocated( tsd_t
*TSD
, cparamboxptr parms
)
69 checkparam( parms
, 0, 1 , "ALLOCATED" ) ;
73 ch
= getonechar( TSD
, parms
->value
, "ALLOCATED", 1 ) ;
78 ptr
= int_to_streng( TSD
,have_allocated(TSD
, MEM_ALLOC
)) ;
82 ptr
= int_to_streng( TSD
,have_allocated(TSD
, MEM_LEAKED
)) ;
86 ptr
= int_to_streng( TSD
,have_allocated(TSD
, MEM_CURRENT
)) ;
90 ptr
= Str_makeTSD( 132 ) ;
91 sprintf( ptr
->value
,"Memory: Allocated=%d, Current=%d, Leaked=%d",
92 have_allocated(TSD
, MEM_ALLOC
),
93 have_allocated(TSD
, MEM_CURRENT
),
94 have_allocated(TSD
, MEM_LEAKED
)) ;
96 ptr
->len
= strlen( ptr
->value
) ;
97 assert( ptr
->len
<= ptr
->max
) ;
101 exiterror( ERR_INCORRECT_CALL
, 28, "ALLOCATED", "ALCS", tmpstr_of( TSD
, parms
->value
) ) ;
109 streng
*dbg_dumptree( tsd_t
*TSD
, cparamboxptr dummy
)
111 dumptree( TSD
, TSD
->systeminfo
->tree
.root
, 1, 1 ) ;
112 dummy
= dummy
; /* keep compiler happy */
113 return nullstringptr() ;
120 streng
*dbg_listleaked( tsd_t
*TSD
, cparamboxptr parms
)
125 checkparam( parms
, 0, 1 , "LISTLEAKED" ) ;
127 ch
= getonechar( TSD
, parms
->value
, "LISTLEAKED", 1 ) ;
132 i
= listleaked( TSD
, MEMTRC_NONE
) ;
134 i
= listleaked( TSD
, MEMTRC_LEAKED
) ;
136 i
= listleaked( TSD
, MEMTRC_ALL
) ;
138 exiterror( ERR_INCORRECT_CALL
, 28, "LISTLEAKED", "ALN", tmpstr_of( TSD
, parms
->value
) ) ;
140 return int_to_streng( TSD
, i
) ;