2 debug.cc -- implement debugging routines
4 source file of the GNU LilyPond music typesetter
6 (c) 1996,98 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13 // #include <std/new.h>
19 #include "flower-debug.hh"
24 Dstream
*my_monitor
=0;
29 cerr
<< _ ("floating point exception") << endl
;
36 my_monitor
= new Dstream (&cout
, ".dstreamrc");
37 signal (SIGFPE
, float_handler
);
40 bool check_malloc_b
= false;
42 // #define MEMORY_PARANOID
44 #ifdef MEMORY_PARANOID
49 frobnify (void *p
, size_t s
)
61 operator new (size_t size
)
64 result
= malloc (size
);
66 frobnify (result
, size
);
70 void *to_frob
; int frob_size
;
73 set_frobnify (void * p
, size_t sz
)
80 operator delete (void *p
)
86 frobnify (p
, frob_size
);
93 #endif // MEMORY_PARANOID
99 flower_dstream
= my_monitor
;
103 #ifdef MEMORY_PARANOID
106 warning (_ ("Can't set mem-checking!"));