/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
void _STUB_vmdebug(){}
#else
#include "vmhdr.h"
/* Method to help with debugging. This does rigorous checks on
** addresses and arena integrity.
**
** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
*/
/* structure to keep track of file names */
struct _dbfile_s
};
/* global watch list */
static int Dbnwatch;
/* types of warnings reported by dbwarn() */
#define DB_CHECK 0
static int Dbinit = 0;
static void dbinit()
{ int fd;
}
#if __STD_C
#else
int fd;
#endif
{
return old;
}
/* just an entry point to make it easy to set break point */
#if __STD_C
#else
char* mesg;
int n;
#endif
{
abort();
}
/* issue a warning of some type */
#if __STD_C
#else
int where; /* byte that was corrupted */
char* file; /* file where call originates */
int line; /* line number of call */
int type; /* operation being done */
#endif
{
DBINIT();
/* region info */
if(data)
}
if(!data)
}
{ if(where == 0)
}
else if(where == DB_RESIZED)
}
}
}
/* location where offending call originates from */
}
*bufp++ = '\n';
*bufp = '\0';
}
/* check for watched address and issue warnings */
#if __STD_C
#else
char* file;
int line;
int type;
#endif
{
reg int n;
for(n = Dbnwatch; n >= 0; --n)
return;
}
}
}
/* record information about the block */
#if __STD_C
#else
char* file; /* file where the request came from */
int line; /* and line number */
#endif
{
DBINIT();
/* find the file structure */
else
break;
if(!db)
if(db)
}
}
else if(last) /* move-to-front heuristic */
}
}
}
/* Check to see if an address is in some data block of a region.
** This returns -(offset+1) if block is already freed, +(offset+1)
** if block is live, 0 if no match.
*/
#if __STD_C
#else
int local;
#endif
{
break;
}
if(!seg)
goto done;
if(local) /* must be vmfree or vmresize checking address */
offset = 0;
else offset = -2L;
}
goto done;
}
while(b < endb)
}
goto done;
}
}
done:
return offset;
}
#if __STD_C
#else
int local;
#endif
{
long size;
size = -1L;
continue;
while(b < endb)
goto done;
}
}
}
done:
return size;
}
#if __STD_C
#else
int local;
#endif
{
size_t s;
char *file;
int line;
if(s < sizeof(Body_t)) /* no tiny blocks during Vmdebug */
s = sizeof(Body_t);
goto done;
}
}
if(Dbnwatch > 0 )
done:
}
#if __STD_C
#else
int local;
#endif
{
char *file;
int line;
long offset;
if(!data)
return 0;
rv = -1;
}
else
{ if(Dbnwatch > 0)
}
/* clear free space */
*ip++ = 0;
}
return rv;
}
/* Resizing an existing block */
#if __STD_C
#else
int type; /* !=0 for movable, >0 for copy */
int local;
#endif
{
long offset;
if(!addr)
return data;
}
if(size == 0)
}
}
else
{ if(Dbnwatch > 0)
/* Vmbest data block */
/* do the resize */
if(s < sizeof(Body_t))
s = sizeof(Body_t);
if(!data) /* failed, reset data for old block */
}
else
}
if(Dbnwatch > 0)
}
do { *d++ = 0; } while(d < ed);
}
}
}
/* compact any residual free space */
#if __STD_C
#else
int local;
#endif
{
}
/* check for memory overwrites over all live blocks */
#if __STD_C
#else
#endif
{
int rv;
/* check the meta-data of this region */
return -1;
return 0;
}
else return -1;
rv = 0;
while(b < endb)
goto next;
{ rv += 1;
goto next;
}
goto set_bad;
continue;
rv += 1;
goto next;
}
}
}
return rv;
}
#if __STD_C
#else
#endif
{
reg int n;
if(!addr)
Dbnwatch = 0;
else
{ for(n = Dbnwatch - 1; n >= 0; --n)
break;
if(n < 0) /* insert */
{ /* delete left-most */
Dbnwatch -= 1;
for(n = 0; n < Dbnwatch; ++n)
}
Dbnwatch += 1;
}
}
return out;
}
#if __STD_C
#else
int local;
#endif
{
size_t s;
char *file;
int line;
s = sizeof(Body_t);
}
}
}
/* print statistics of region vm. If vm is NULL, use Vmregion */
#if __STD_C
#else
#endif
*bufp = 0;
}
{
};
#ifdef NoF
#endif
#endif