~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to ddd/MemCheck.C

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: MemCheck.C,v 1.16 2000/12/11 12:21:47 zeller Exp $ -*- C++ -*-
 
1
// $Id$ -*- C++ -*-
2
2
// Memory checker
3
3
 
4
4
// Copyright (C) 1995 Technische Universitaet Braunschweig, Germany.
27
27
// or send a mail to the DDD developers <ddd@gnu.org>.
28
28
 
29
29
char MemCheck_rcsid[] =
30
 
    "$Id: MemCheck.C,v 1.16 2000/12/11 12:21:47 zeller Exp $";
31
 
 
32
 
#ifdef __GNUG__
33
 
#pragma implementation
34
 
#endif
 
30
    "$Id$";
35
31
 
36
32
#include "MemCheck.h"
37
33
#include "config.h"
65
61
{
66
62
    if (p->s.magic != MAGIC)
67
63
    {
68
 
        cerr << src << ": memory corrupted at " << (void *)p << "\n";
 
64
        std::cerr << src << ": memory corrupted at " << (void *)p << "\n";
69
65
        abort();
70
66
    }
71
67
}
122
118
            void *ret = (void *)(p + 1);
123
119
 
124
120
            if (log)
125
 
                clog << "alloc: " << nbytes << " bytes "
 
121
                std::clog << "alloc: " << nbytes << " bytes "
126
122
                     << "in block " << p->s.tic << " at " << ret << "\n";
127
123
            
128
124
            return ret;
177
173
    validate(bp, "free");
178
174
 
179
175
    if (log)
180
 
        clog << "free:  " << bp->s.requested << " bytes "
 
176
        std::clog << "free:  " << bp->s.requested << " bytes "
181
177
             << "in block " << bp->s.tic << " at " << ap << "\n";
182
178
 
183
179
    if (wipeout_free)
206
202
        if (p == allocp)
207
203
        {
208
204
            // We traversed the whole list without finding the block
209
 
            cerr << "free: cannot find block at " << ap << "\n";
 
205
            std::cerr << "free: cannot find block at " << ap << "\n";
210
206
            abort();
211
207
        }
212
208
    }
264
260
 
265
261
 
266
262
// Issue an allocation map -- using the alloc list
267
 
void MemCheck::map(ostream& os, unsigned start, const char *prefix)
 
263
void MemCheck::map(std::ostream& os, unsigned start, const char *prefix)
268
264
{
269
265
    init();
270
266