🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Dirk Grunwald Wed, 22 Mar 1989 19:10
bug in operator delete
#1782
Author: Dirk Grunwald
Date: Wed, 22 Mar 1989 19:10
1933 lines
66939 bytes
This appears in g++ 1.34.1 for an Encore and also a Sun-3/60 w/SunOS4.0.1.

I have a class (Message) that declares

    void operator delete(void *);

and class Task uses this when deleting items. However, g++ gives me a
message " `this' has no member function named delete". Other classes with
`operator delete' work with no problems.

When I run c++ using gdb, I find that this message is from cplus-class.c,
line 2512:
      if (field == NULL_TREE)
	{
	  error ("`this' has no member named `%s'", err_name);

If this is indeed a bug, I'd appreciate a patch if one is available.

# 1 "../Src/Task.cc"
# 1 "/usr/local/include/Awe2/assert.h"
# 1 "/usr/local/include/Awe2/Generic.h"
# 51 "/usr/local/include/Awe2/Generic.h"
# 28 "/usr/local/include/Awe2/assert.h"
extern void _assert(const char *, const char *, const int);
extern void _assert2(const char *, const char *, const int, const char *);
# 1 "../Src/Task.cc"
# 1 "/usr/local/include/Awe2/SimulationMultiplexor.h"
# 1 "/usr/local/include/Awe2/CpuMultiplexor.h"
# 1 "/usr/local/include/Awe2/Config.h"
const static int MaxCpuMultiplexors = 1;
const static int DefaultSpinBarrierLoops = 0;
const static int DefaultBarrierLoops = 0;
# 10 "/usr/local/include/Awe2/CpuMultiplexor.h"
# 1 "/usr/local/include/Awe2/HardwareContext.h"
# 1 "/usr/local/Gnu/lib/g++-include/stream.h"
# 1 "/usr/local/Gnu/lib/g++-include/File.h"
# 1 "/usr/local/Gnu/lib/g++-include/builtin.h"
overload clearbit;
overload dec;
overload even;
overload gcd;
overload hex;
overload lcm;
overload lg;
overload oct;
overload odd;
overload setbit;
overload sign;
overload sqr;
overload testbit;
# 1 "/usr/local/Gnu/lib/g++-include/std.h"
overload abs; 
extern void      _exit  (int) asm ("_" "_exit") ;
extern void      abort  () asm ("_" "abort") ;
extern int       abs  (int) asm ("_" "abs") ;
extern int       access  (const char*, int) asm ("_" "access") ;
extern int       acct  (const char*) asm ("_" "acct") ;
extern unsigned  alarm  (unsigned) asm ("_" "alarm") ;
extern void*     alloca  (int) asm ("_" "alloca") ;
extern double    atof  (const char*) asm ("_" "atof") ;
extern int       atoi  (const char*) asm ("_" "atoi") ;
extern long      atol  (const char*) asm ("_" "atol") ;
extern int       bcmp  (const void*, const void*, int) asm ("_" "bcmp") ;
extern void      bcopy  (const void*, void*, int) asm ("_" "bcopy") ;
extern void*     brk  (void*) asm ("_" "brk") ;
extern void      bzero  (void*, int) asm ("_" "bzero") ;
extern void*     calloc  (unsigned, unsigned) asm ("_" "calloc") ;
extern void      cfree  (void*) asm ("_" "cfree") ;
extern int       chdir  (const char*) asm ("_" "chdir") ;
extern int       chmod  (const char*, int) asm ("_" "chmod") ;
extern int       chown  (const char*, int, int) asm ("_" "chown") ;
extern long      clock  () asm ("_" "clock") ;
extern int       close  (int) asm ("_" "close") ;
extern int       creat  (const char*, int) asm ("_" "creat") ;
extern char*     crypt  (const char*, const char*) asm ("_" "crypt") ;
extern char*     ctermid  (char*) asm ("_" "ctermid") ;
extern char*     cuserid  (char*) asm ("_" "cuserid") ;
extern double    drand48  () asm ("_" "drand48") ;
extern int       dup  (int) asm ("_" "dup") ;
extern int       dup2  (int, int) asm ("_" "dup2") ;
extern int       dysize  (int) asm ("_" "dysize") ;
extern char*     ecvt  (double, int, int*, int*) asm ("_" "ecvt") ;
extern char*     encrypt  (char*, int) asm ("_" "encrypt") ;
extern double    erand  (short*) asm ("_" "erand") ;
extern int       execl  (const char*, const char *, ...) asm ("_" "execl") ;
extern int       execle  (const char*, const char *, ...) asm ("_" "execle") ;
extern int       execlp  (const char*, const char*, ...) asm ("_" "execlp") ;
extern int       exect  (const char*,  const char**,  char**) asm ("_" "exect") ;
extern int       execv  (const char*,  const char**) asm ("_" "execv") ;
extern int       execve  (const char*, const char**, char**) asm ("_" "execve") ;
extern int       execvp  (const char*,  const char**) asm ("_" "execvp") ;
extern void      exit  (int) asm ("_" "exit") ;
extern int       fchmod  (int, int) asm ("_" "fchmod") ;
extern int       fchown  (int, int, int) asm ("_" "fchown") ;
extern int       fcntl  (int, int, int) asm ("_" "fcntl") ;
extern char*     fcvt  (double, int, int*, int*) asm ("_" "fcvt") ;
extern int       ffs  (int) asm ("_" "ffs") ;
extern int       flock  (int, int) asm ("_" "flock") ;
extern int       fork  () asm ("_" "fork") ;
extern void      free  (void*) asm ("_" "free") ;
extern int       fsync  (int) asm ("_" "fsync") ;
extern long      ftok  (const char*, int) asm ("_" "ftok") ;
extern int       ftruncate  (int, unsigned long) asm ("_" "ftruncate") ;
extern char*     gcvt  (double, int, char*) asm ("_" "gcvt") ;
extern char*     getcwd  (char*, int) asm ("_" "getcwd") ;
extern int       getdomainname  (char*, int) asm ("_" "getdomainname") ;
extern int       getdtablesize  () asm ("_" "getdtablesize") ;
extern int       getegid  () asm ("_" "getegid") ;
extern char*     getenv  (const char*) asm ("_" "getenv") ;
extern int       geteuid  () asm ("_" "geteuid") ;
extern int       getgid  () asm ("_" "getgid") ;
extern int       getgroups  (int, int*) asm ("_" "getgroups") ;
extern long      gethostid  () asm ("_" "gethostid") ;
extern int       gethostname  (char*, int) asm ("_" "gethostname") ;
extern char*     getlogin  () asm ("_" "getlogin") ;
extern int       getopt  (int, char**, char*) asm ("_" "getopt") ;
extern int       getpagesize  () asm ("_" "getpagesize") ;
extern char*     getpass  (const char*) asm ("_" "getpass") ;
extern int       getpgrp  () asm ("_" "getpgrp") ;
extern int       getpid  () asm ("_" "getpid") ;
extern int       getppid  () asm ("_" "getppid") ;
extern int       getpriority  (int, int) asm ("_" "getpriority") ;
extern int       getpw  (int, char*) asm ("_" "getpw") ;
extern unsigned  getuid  () asm ("_" "getuid") ;
extern char*     getwd  (const char*) asm ("_" "getwd") ;
extern char*     index  (const char*, int) asm ("_" "index") ;
extern char*     initstate  (unsigned, char*, int) asm ("_" "initstate") ;
extern int       ioctl  (int, int, char*) asm ("_" "ioctl") ;
extern int       isatty  (int) asm ("_" "isatty") ;
extern long      jrand48  (short*) asm ("_" "jrand48") ;
extern int       kill  (int, int) asm ("_" "kill") ;
extern int       killpg  (int, int) asm ("_" "killpg") ;
extern void      lcong48  (short*) asm ("_" "lcong48") ;
extern int       link  (const char*, const char*) asm ("_" "link") ;
extern int       lock  (int, int, long) asm ("_" "lock") ;
extern long      lrand48  () asm ("_" "lrand48") ;
extern long      lseek  (int, long, int) asm ("_" "lseek") ;
extern void*     malloc  (unsigned) asm ("_" "malloc") ;
extern void*     memalign  (unsigned, unsigned) asm ("_" "memalign") ;
extern void*     memccpy  (void*, const void*, int, int) asm ("_" "memccpy") ;
extern void*     memchr  (const void*, int, int) asm ("_" "memchr") ;
extern int       memcmp  (const void*, const void*, int) asm ("_" "memcmp") ;
extern void*     memcpy  (void*, const void*, int) asm ("_" "memcpy") ;
extern void*     memset  (void*, int, int) asm ("_" "memset") ;
extern int       mkdir  (const char*, int) asm ("_" "mkdir") ;
extern int       mknod  (const char*, int, int) asm ("_" "mknod") ;
extern int       mkstemp  (char*) asm ("_" "mkstemp") ;
extern char*     mktemp  (char*) asm ("_" "mktemp") ;
extern long      mrand48  () asm ("_" "mrand48") ;
extern int       nice  (int) asm ("_" "nice") ;
extern long      nrand48  (short*) asm ("_" "nrand48") ;
extern int       open  (const char*, int, ...) asm ("_" "open") ;
extern void      pause  () asm ("_" "pause") ;
extern void      perror  (const char*) asm ("_" "perror") ;
extern int       pipe   (int*) asm ("_" "pipe") ;
extern void      profil  (char*, int, int, int) asm ("_" "profil") ;
extern int       psignal  (unsigned, char*) asm ("_" "psignal") ;
extern int       ptrace  (int, int, int, int) asm ("_" "ptrace") ;
extern int       putenv  (const char*) asm ("_" "putenv") ;
extern int       rand  () asm ("_" "rand") ;
extern long      random  () asm ("_" "random") ;
extern int       read  (int, void*, unsigned) asm ("_" "read") ;
extern int       readlink  (const char*, char*, int) asm ("_" "readlink") ;
extern void*     realloc  (void*, unsigned) asm ("_" "realloc") ;
extern int       rename  (const char*, const char*) asm ("_" "rename") ;
extern char*     rindex  (const char*, int) asm ("_" "rindex") ;
extern int       rmdir  (const char*) asm ("_" "rmdir") ;               
extern void*     sbrk  (int) asm ("_" "sbrk") ;              
extern short*    seed48  (short*) asm ("_" "seed48") ;
extern int       send  (int, char*, int, int) asm ("_" "send") ;
extern int       setgid  (int) asm ("_" "setgid") ;
extern int       sethostname  (char*, int) asm ("_" "sethostname") ;
extern int       setkey  (const char*) asm ("_" "setkey") ;
extern int       setpgrp  (int, int) asm ("_" "setpgrp") ;
extern int       setpriority  (int, int, int) asm ("_" "setpriority") ;
extern int       setregid  (int, int) asm ("_" "setregid") ;
extern int       setreuid  (int, int) asm ("_" "setreuid") ;
extern char*     setstate  (char*) asm ("_" "setstate") ;
extern int       setuid  (int) asm ("_" "setuid") ;
extern int       sigblock  (int) asm ("_" "sigblock") ;
extern int       siginterrupt  (int, int) asm ("_" "siginterrupt") ;
extern int       sigpause  (int) asm ("_" "sigpause") ;
extern int       sigsetmask  (int) asm ("_" "sigsetmask") ;
extern unsigned  sleep  (unsigned) asm ("_" "sleep") ;
extern int       srand  (int) asm ("_" "srand") ;
extern void      srand48  (long) asm ("_" "srand48") ;
extern void      srandom  (int) asm ("_" "srandom") ;
extern int       stime  (long*) asm ("_" "stime") ;
extern char*     strcat  (char*, const char*) asm ("_" "strcat") ;
extern char*     strchr  (const char*, int) asm ("_" "strchr") ;
extern int       strcmp  (const char*, const char*) asm ("_" "strcmp") ;
extern char*     strcpy  (char*, const char*) asm ("_" "strcpy") ;
extern int       strcspn  (const char*, const char*) asm ("_" "strcspn") ;
extern char*     strdup  (const char*) asm ("_" "strdup") ;
extern int       strlen  (const char*) asm ("_" "strlen") ;
extern char*     strncat  (char*, const char*, int) asm ("_" "strncat") ;
extern int       strncmp  (const char*, const char*, int) asm ("_" "strncmp") ;
extern char*     strncpy  (char*, const char*, int) asm ("_" "strncpy") ;
extern char*     strpbrk  (const char*, const char*) asm ("_" "strpbrk") ;
extern char*     strrchr  (const char*, int) asm ("_" "strrchr") ;
extern int       strspn  (const char*, const char*) asm ("_" "strspn") ;
extern double    strtod  (const char*, char**) asm ("_" "strtod") ;
extern char*     strtok  (char*, const char*) asm ("_" "strtok") ;
extern long      strtol  (const char*, char**, int) asm ("_" "strtol") ;
extern void      swab  (void*, void*, int) asm ("_" "swab") ;
extern int       symlink  (const char*, const char*) asm ("_" "symlink") ;
extern int       syscall  (int, ...) asm ("_" "syscall") ;
extern int       system  (const char*) asm ("_" "system") ;
extern char*     tempnam  (char*, char*) asm ("_" "tempnam") ;
extern int       tgetent  (char*, char*) asm ("_" "tgetent") ;
extern int       tgetnum  (char*) asm ("_" "tgetnum") ;
extern int       tgetflag  (char*) asm ("_" "tgetflag") ;
extern char*     tgetstr  (char *, char **) asm ("_" "tgetstr") ;
extern char*     tgoto  (char*, int, int) asm ("_" "tgoto") ;
extern long      time  (long*) asm ("_" "time") ;
extern char*     tmpnam  (char*) asm ("_" "tmpnam") ;
extern int       truncate  (const char*, unsigned long) asm ("_" "truncate") ;
extern char*     ttyname  (int) asm ("_" "ttyname") ;
extern int       ttyslot  () asm ("_" "ttyslot") ;
extern unsigned  ualarm  (unsigned, unsigned) asm ("_" "ualarm") ;
extern long      ulimit  (int, long) asm ("_" "ulimit") ;
extern int       umask  (int) asm ("_" "umask") ;
extern int       unlink  (const char*) asm ("_" "unlink") ;
extern unsigned  usleep  (unsigned) asm ("_" "usleep") ;
extern int       vadvise  (int) asm ("_" "vadvise") ;
extern void*     valloc  (unsigned) asm ("_" "valloc") ;
extern int       vfork  () asm ("_" "vfork") ;
extern int       vhangup  () asm ("_" "vhangup") ;
extern int       wait  (int*) asm ("_" "wait") ;
extern int       write  (int, const void*, unsigned) asm ("_" "write") ;
extern char**   environ;
extern int      errno;
extern char*    sys_errlist[];
extern int      sys_nerr;                  
extern char*    optarg;
extern int      opterr;
extern int      optind;
# 48 "/usr/local/Gnu/lib/g++-include/builtin.h"
# 1 "/usr/local/Gnu/lib/g++-include/stddef.h"
enum bool   
{           
  FALSE = 0,
  TRUE  = 1              
};
typedef void (*one_arg_error_handler_t)(const char*);
typedef void (*two_arg_error_handler_t)(const char*, const char*);
# 49 "/usr/local/Gnu/lib/g++-include/builtin.h"
# 1 "/usr/local/Gnu/lib/g++-include/math.h"
overload acos;
overload acosh;
overload asin;
overload asinh;
overload atan2;
overload atanh;
overload ceil;
overload cos;
overload cosh;
overload exp;
overload floor;
overload gamma;
overload hypot;
overload log;
overload log10;
overload pow;
overload sin;
overload sinh;
overload sqrt;
overload tan;
overload tanh;
extern double  acos  (double) asm ("_" "acos") ;
extern double  acosh  (double) asm ("_" "acosh") ;
extern double  asin  (double) asm ("_" "asin") ;
extern double  asinh  (double) asm ("_" "asinh") ;
extern double  atan  (double) asm ("_" "atan") ;
extern double  atan2  (double, double) asm ("_" "atan2") ;
extern double  atanh  (double) asm ("_" "atanh") ;
extern double  cbrt  (double) asm ("_" "cbrt") ;
extern double  ceil  (double) asm ("_" "ceil") ;
extern double  copysign  (double,double) asm ("_" "copysign") ;
extern double  cos  (double) asm ("_" "cos") ;
extern double  cosh  (double) asm ("_" "cosh") ;
extern double  drem  (double,double) asm ("_" "drem") ;
extern double  erf  (double) asm ("_" "erf") ;
extern double  erfc  (double) asm ("_" "erfc") ;
extern double  exp  (double) asm ("_" "exp") ;
extern double  expm1  (double) asm ("_" "expm1") ;
extern double  fabs  (double) asm ("_" "fabs") ;
extern double  finite  (double) asm ("_" "finite") ;
extern double  floor  (double) asm ("_" "floor") ;
extern double  frexp  (double, int*) asm ("_" "frexp") ;
extern double  gamma  (double) asm ("_" "gamma") ;
extern double  hypot  (double,double) asm ("_" "hypot") ;
extern double  infnan  (int) asm ("_" "infnan") ;
extern int     isinf  (double) asm ("_" "isinf") ;
extern int     isnan  (double) asm ("_" "isnan") ;
extern double  j0  (double) asm ("_" "j0") ;
extern double  j1  (double) asm ("_" "j1") ;
extern double  jn  (int, double) asm ("_" "jn") ;
extern double  ldexp  (double, int) asm ("_" "ldexp") ;
extern double  lgamma  (double) asm ("_" "lgamma") ;
extern double  log  (double) asm ("_" "log") ;
extern double  log10  (double) asm ("_" "log10") ;
extern double  log1p  (double) asm ("_" "log1p") ;
extern double  logb  (double) asm ("_" "logb") ;
extern double  modf  (double, double*) asm ("_" "modf") ;
extern double  pow  (double, double) asm ("_" "pow") ;
extern double  rint  (double) asm ("_" "rint") ;
extern double  scalb  (double, int) asm ("_" "scalb") ;
extern double  sin  (double) asm ("_" "sin") ;
extern double  sinh  (double) asm ("_" "sinh") ;
extern double  sqrt  (double) asm ("_" "sqrt") ;
extern double  tan  (double) asm ("_" "tan") ;
extern double  tanh  (double) asm ("_" "tanh") ;
extern double  y0  (double) asm ("_" "y0") ;
extern double  y1  (double) asm ("_" "y1") ;
extern double  yn  (int, double) asm ("_" "yn") ;
struct exception
{
  int type;
  char* name;
  double arg1, arg2, retval;
};
int matherr(exception*);
# 1 "/usr/local/Gnu/lib/g++-include/values.h"
# 92 "/usr/local/Gnu/lib/g++-include/values.h"
# 126 "/usr/local/Gnu/lib/g++-include/math.h"
# 50 "/usr/local/Gnu/lib/g++-include/builtin.h"
long         abs(long);
double       abs(double);
void         clearbit(long&, long);
void         setbit(long&, long);
int          testbit(long, long);
int          even(long);
long         gcd(long, long);
long         lg(long); 
long         lcm(long, long);
int          odd(long);
double       pow(double, long);
long         pow(long, long);
int          sign(long);
int          sign(double);
long         sqr(long);
double       sqr(double);
long         sqrt(long);
double       start_timer();
double       return_elapsed_time(double);
char*        itoa(long x, int base = 10, int width = 0);
char*        hex(long x, int width = 0);
char*        oct(long x, int width = 0);
char*        dec(long x, int width = 0);
char*        form(const char* fmt ...);
unsigned int hashpjw(const char*);
unsigned int multiplicativehash(int);
unsigned int foldhash(double);
extern void default_one_arg_error_handler(const char*);
extern void default_two_arg_error_handler(const char*, const char*);
extern two_arg_error_handler_t lib_error_handler;
extern two_arg_error_handler_t 
       set_lib_error_handler(two_arg_error_handler_t f);
inline double abs(double _arg) 
{
  return (_arg < 0.0)? -_arg : _arg;
}
inline long abs(long _arg) 
{
  return (_arg < 0)? -_arg : _arg;
}
inline int sign(long _arg)
{
  return (_arg == 0) ? 0 : ( (_arg > 0) ? 1 : -1 );
}
inline int sign(double _arg)
{
  return (_arg == 0.0) ? 0 : ( (_arg > 0.0) ? 1 : -1 );
}
inline long sqr(long _arg)
{
  return _arg * _arg;
}
inline double sqr(double _arg)
{
  return _arg * _arg;
}
inline int even(long _arg)
{
  return !(_arg & 1);
}
inline int odd(long _arg)
{
  return (_arg & 1);
}
inline long lcm(long _x, long _y)
{
  return _x / gcd(_x, _y) * _y;
}
inline void setbit(long& _x, long _b)
{
  _x |= (1 << _b);
}
inline void clearbit(long& _x, long _b)
{
  _x &= ~(1 << _b);
}
inline int testbit(long _x, long _b)
{
  return ((_x & (1 << _b)) != 0);
}
# 27 "/usr/local/Gnu/lib/g++-include/File.h"
# 1 "/usr/local/Gnu/lib/g++-include/stdio.h"
extern  struct  _iobuf {
    int      _cnt;
    char*    _ptr;
    char*    _base;
    int     _bufsiz;
    short   _flag;
    char    _file;
} _iob[];
extern int    _doprnt(const char*, void*,     struct _iobuf *);
extern int    _doscan(    struct _iobuf *, const char*, void*);
extern int    _filbuf(    struct _iobuf *);
extern int    _flsbuf(unsigned,     struct _iobuf *);
extern int    fclose(    struct _iobuf *);
extern     struct _iobuf *  fdopen(int, const char*);
extern int    fflush(    struct _iobuf *);
extern int    fgetc(    struct _iobuf *);
extern char*  fgets(char*, int,     struct _iobuf  *);
extern     struct _iobuf *  fopen(const char*, const char*);
extern int    fprintf(    struct _iobuf *, const char* ...);
extern int    fputc(int,     struct _iobuf *);
extern int    fputs(const char*,     struct _iobuf *);
extern int    fread(void*, int, int,     struct _iobuf *);
extern     struct _iobuf *  freopen(const char*, const char*,     struct _iobuf *);
extern int    fscanf(    struct _iobuf *, const char* ...);
extern int    fseek(    struct _iobuf *, long, int);
extern long   ftell(    struct _iobuf  *);
extern int    fwrite(const void*, int, int,     struct _iobuf *);
extern char*  gets(char*);
extern int    getw(    struct _iobuf *);
extern int    pclose(    struct _iobuf *);
extern     struct _iobuf *  popen(const char*, const char*);
extern int    printf(const char* ...);
extern void   puts(const char*);
extern int    putw(int,     struct _iobuf *);
extern int    scanf(const char* ...);
extern void   setbuf(    struct _iobuf *, char*);
extern void   setbuffer(    struct _iobuf *, char*, int);
extern void   setlinebuf(    struct _iobuf *);
extern void   setvbuf(    struct _iobuf *, char*, int, int);
extern int    sscanf(char*, const char* ...);
extern     struct _iobuf *  tmpfile();
extern int    ungetc(int,     struct _iobuf *);
extern int    vfprintf(    struct _iobuf *, const char*, void* ap);
extern int    vprintf(const char*, void* ap);
extern int    vsprintf(char*, const char*, void* ap);
extern int    sprintf(char*, const char* ...);
# 28 "/usr/local/Gnu/lib/g++-include/File.h"
# 1 "/usr/local/Gnu/lib/g++-include/stddef.h"
# 59 "/usr/local/Gnu/lib/g++-include/stddef.h"
# 29 "/usr/local/Gnu/lib/g++-include/File.h"
enum io_mode                     
{
  io_readonly   = 0,            
  io_writeonly  = 1,
  io_readwrite  = 2, 
  io_appendonly = 3,
  io_append     = 4,             
};
enum access_mode                 
{
  a_createonly  = 0,             
  a_create      = 1,             
  a_useonly     = 2,             
  a_use         = 3,             
};
enum state_value                 
{ 
  _good         = 0,             
  _eof          = 1,             
  _fail         = 2,             
  _bad          = 4              
};
class File
{
protected:
      struct _iobuf *         fp;               
  char*         nm;               
  char          rw;               
  state_value   state;            
  long          stat;             
  void          initialize();
  void          reinitialize(const char*);
public:
                File();
                File(const char* filename, io_mode m, access_mode a);
                File(const char* filename, const char* m);   
                File(int filedesc, io_mode m);
                File(    struct _iobuf * fileptr);
                File(int sz, char* buf, io_mode m);
                ~File();
  File&         open(const char* filename, io_mode m, access_mode a);
  File&         open(const char* filename, const char* m);
  File&         open(int  filedesc, io_mode m);
  File&         open(    struct _iobuf * fileptr);
  File&         close();
  File&         remove();
  int           filedesc();
  const char*   name();
  void          setname(const char* newname);
  int           iocount();
  int           rdstate();
  int           eof();
  int           fail();
  int           bad();
  int           good();
  int           readable();
  int           writable();
  int           is_open();
  void*         operator void*();
  void          error();
  void          clear(state_value f = 0);  
  File&         failif(int cond);
  void          check_state();
  File&         get(char& c);
  File&         put(char  c);
  File&         unget(char c);
  File&         putback(char c);  
  File&         put(const char* s);
  File&         get    (char* s, int n, char terminator = '\n');
  File&         getline(char* s, int n, char terminator = '\n');
  File&         read(void* x, int sz, int n);
  File&         write(void* x, int sz, int n);
  File&         seek(long pos, int seek_mode=0);  
  long          tell();
  File&         flush();
  File&         setbuf(int buffer_kind);  
  File&         setbuf(int size, char* buf);
  File&         raw();
};
extern void  verbose_File_error_handler(char*);
extern void  quiet_File_error_handler(char*);
extern void  fatal_File_error_handler(char*);
extern one_arg_error_handler_t File_error_handler;
extern one_arg_error_handler_t set_File_error_handler(one_arg_error_handler_t);
inline int File::filedesc()
{ 
  return   ((fp)->_file) ;
}
inline const char* File::name()
{ 
  return nm; 
}
inline int File::iocount()
{ 
  return stat; 
}
inline int File::readable()
{ 
  if (fp != 0) { if (    (((fp)->_flag&   00020 )!=0) ) state |= _eof; if (  (((fp)->_flag&   00040 )!=0) ) state |= _bad;}
  return (state == _good && (rw & 01));
}
inline int File::writable()
{ 
  if (fp != 0 &&   (((fp)->_flag&   00040 )!=0) ) state |= _bad;
  return ((state & (_fail|_bad)) == 0 && (rw & 02));
}
inline int File::is_open()
{ 
  return (fp != 0);
}
inline void File::clear(state_value flag = 0)
{ 
  state = flag;
}
inline File& File::raw()
{ 
  return File::setbuf(   00004 ); 
}
inline void File::check_state()  
{
  if (fp != 0)
  {
    if (    (((fp)->_flag&   00020 )!=0) )
      state |= _eof;
    else
      state &= ~_eof;
    if (  (((fp)->_flag&   00040 )!=0) )
      state |= _bad;
  }
}
inline File& File::failif(int cond)
{ 
  if (cond) state |= _fail;  return *this; 
}
inline File& File::get(char& c)
{ 
  if (readable())
  {
    int ch = (--(fp)->_cnt>=0?(int)(*(unsigned char*)(fp)->_ptr++):_filbuf(fp)) ;
    c = ch;
    failif (ch ==       (-1) );
  }
  return *this;
}
inline File& File::put(char  c) 
{ 
  return failif (!writable() ||  (--( fp)->_cnt>=0? ((int)((unsigned char)((*( fp)->_ptr++=(unsigned)(c))))):_flsbuf((unsigned)(c), fp))  ==       (-1) );
}
inline File& File::unget(char c)
{ 
  return failif(!is_open() || !(rw & 01) || ungetc(c, fp) ==       (-1) );
} 
inline File& File::putback(char c)
{ 
  return failif (!is_open() || !(rw & 01) || ungetc(c, fp) ==       (-1) );
}
inline File& File::read(void* x, int sz, int n)
{ 
  return failif (!readable() || (stat = fread(x, sz, n, fp)) != n);
} 
inline File& File::write(void* x, int sz, int n) 
{ 
  return failif (!writable() || (stat = fwrite(x, sz, n, fp)) != n);
}
inline File& File::flush()
{ 
  return failif(!is_open() || fflush(fp) ==       (-1) );
}
inline File& File::seek(long pos, int seek_mode = 0)
{ 
  return failif (!is_open() || fseek(fp, pos, seek_mode) < 0); 
}
inline long File::tell()
{ 
  failif (!is_open() || (stat = ftell(fp) < 0));
  return stat;
}
inline int File::rdstate()
{ 
  check_state();  return state;  
}                                
inline void* File::operator void*()
{ 
  check_state();  return (state & (_bad|_fail))? 0 : this ; 
}
inline int File::eof()
{ 
  check_state(); return state & _eof; 
}
inline int File::fail()
{ 
  check_state(); return state & _fail; 
}
inline int File::bad()
{ 
  check_state(); return state & _bad; 
}
inline int File::good()
{ 
  check_state(); return rdstate() == _good; 
}
# 27 "/usr/local/Gnu/lib/g++-include/stream.h"
class whitespace                 
{                                
  char filler;                     
};
class ostream: File
{
public:
           File::open;      File::close;
           File::remove;    File::filedesc;  File::is_open;
           File::raw;       File::put;       File::check_state;
           File::iocount;   File::error;     File::name;
           File::setname;   File::rdstate;   File::flush;
           File::eof;       File::fail;      File::bad;
           File::good;      File::clear;     File::failif;
           File::setbuf;    File::writable;  File::readable;
           ostream();
           ostream(const char* filename, io_mode m, access_mode a);
           ostream(const char* filename, const char* m);
           ostream(int filedesc, io_mode m = io_writeonly);
           ostream(    struct _iobuf * fileptr);
           ostream(int sz, char* buf);
           ~ostream();
  void*    operator void*();
  ostream& form(const char* fmt, ...);           
  ostream& operator << (char   c);
  ostream& operator << (short  n);
  ostream& operator << (unsigned short n);
  ostream& operator << (int    n);
  ostream& operator << (unsigned int n);
  ostream& operator << (long   n);
  ostream& operator << (unsigned long n);
  ostream& operator << (float  n);
  ostream& operator << (double n);
  ostream& operator << (const char* s);
};
class istream: File
{
protected:
  ostream* tied_to;         
  void     _flush();
public:
           File::open;      File::close;     File::get;
           File::remove;    File::filedesc;  File::is_open;
           File::raw;       File::unget;     File::getline;
           File::iocount;   File::error;     File::name;
           File::setname;   File::rdstate;   File::putback;
           File::eof;       File::fail;      File::bad;
           File::good;      File::clear;     File::failif;
           File::setbuf;    File::writable;  File::readable;
           File::check_state;
           istream();
           istream(const char* filename, io_mode m, access_mode a);
           istream(const char* filename, const char* m);
           istream(int filedesc, io_mode m = io_readonly);
           istream(    struct _iobuf * fileptr);
           istream(int sz, char* buf);
           ~istream();
  void*    operator void*();
  ostream* tie(ostream* s);
  istream& scan(const char* fmt, ...);
  istream& operator >> (char&   c);
  istream& operator >> (short&  n);
  istream& operator >> (unsigned short& n);
  istream& operator >> (int&    n);
  istream& operator >> (unsigned int& n);
  istream& operator >> (long&   n);
  istream& operator >> (unsigned long& n);
  istream& operator >> (float&  n);
  istream& operator >> (double& n);
  istream& operator >> (char*   s);
  istream& operator >> (whitespace& w);
};
void eatwhite(istream& s);
extern istream  cin;              
extern ostream  cout;             
extern ostream  cerr;             
extern whitespace WS;             
inline void* ostream::operator void*()
{ 
  check_state(); return (state & (_bad|_fail))? 0 : this ; 
}
inline ostream& ostream::operator<<(char   c)
{ 
  put(c);  return *this;
}
inline void*    istream::operator void*()
{ 
  check_state(); return (state & (_bad|_fail))? 0 : this ; 
}
inline void istream::_flush()
{
  if (tied_to) tied_to->flush();
}
inline istream& istream::operator>>(char&   c)
{ 
  _flush();  get(c);  return *this;
}
# 10 "/usr/local/include/Awe2/HardwareContext.h"
# 1 "/usr/local/include/Awe2/assert.h"
# 42 "/usr/local/include/Awe2/assert.h"
# 11 "/usr/local/include/Awe2/HardwareContext.h"
extern const long MagicStackMarker;
extern const void * UNINITIALIZED;
typedef enum {stackGrowsUp, stackGrowsDown} StackGrowthDirection;
extern StackGrowthDirection StackGrows;
typedef void (*voidFuncP)();
class HardwareContext;
class SimulationMultiplexor;
class HardwareContext {
    void** saved_fp;	 
    void** saved_sp;	 
    void** stackBase;	 
    void** stackEnd;	 
    unsigned stackMax;	 
    unsigned stackSize;	 
    void **stackMallocAt;
    long *stackCheck;	 
    unsigned checkStackLimits;
    friend class Thread;
    friend class CpuMultiplexor;
    friend class SimulationMultiplexor;
    void switchContext(HardwareContext *to);
    void magicSwitchTo(HardwareContext *to);
    void **getSp();
    void **mallocAt();
    void buildReturnFrame(void * returnThis, voidFuncP returnAddress);
    void stackOverflow();
    HardwareContext(int checked, unsigned stackSize);
public:
    HardwareContext();
    long maxStackDepth();
    void checkStack(int overage = 0);
    void classPrintOn(ostream& strm);
};
inline
HardwareContext::HardwareContext()
{
    int NotReached = 0;
    { if (( NotReached )) ; else _assert( "NotReached", "/usr/local/include/Awe2/HardwareContext.h",73); } ;
}
inline void **
HardwareContext::mallocAt()
{
    return( stackMallocAt );
}
inline ostream&
operator<<(ostream& strm, const HardwareContext& ob)
{
    ob.classPrintOn(strm);
    return strm;
}
inline long
HardwareContext::maxStackDepth()
{
    return( long(stackMax) );
}
inline void
HardwareContext::checkStack(int overage)
{
    unsigned depth = stackBase - getSp() + overage;
    if (stackMax < depth) {
	stackMax = depth;
    }
    if ( stackMax >= stackSize || *stackCheck != MagicStackMarker ) {
	stackOverflow();
    }
}
# 11 "/usr/local/include/Awe2/CpuMultiplexor.h"
# 1 "/usr/local/include/Awe2/CpuMuxExceptions.h"
# 1 "/usr/local/include/Awe2/ExceptionClass.h"
class ExceptionClass {
public:
    ExceptionClass();
    virtual void handleException();
};
inline ExceptionClass::ExceptionClass()
{
}
# 10 "/usr/local/include/Awe2/CpuMuxExceptions.h"
class ReserveByException;
class ExceptionReserve : public ExceptionClass {
    ReserveByException *toReserve;
public:
    ExceptionReserve();
    ReserveByException *reserve();
    void reserve(ReserveByException *);
    virtual void handleException();
};
inline
ExceptionReserve::ExceptionReserve()
{
}
inline ReserveByException *
ExceptionReserve::reserve()
{
    return(toReserve);
}
inline void
ExceptionReserve::reserve(ReserveByException *r)
{
    toReserve = r;
}
class Thread;
class ExceptionTerminate : public ExceptionClass {
    void **stackOfDeadThread;
public:
    ExceptionTerminate();
    void terminate(void **);
    virtual void handleException();
};
inline
ExceptionTerminate::ExceptionTerminate()
{
}
inline void
ExceptionTerminate::terminate(void **r)
{
    stackOfDeadThread = r;
}
class ExceptionReschedule : public ExceptionClass {
    int newCpu;
public:
    ExceptionReschedule();
    void cpu(int = -1);
    virtual void handleException();
};
inline
ExceptionReschedule::ExceptionReschedule()
{
}
inline void
ExceptionReschedule::cpu(int c)
{
    newCpu = c;
}
class ExceptionIveSuspended : public ExceptionClass {
public:
    ExceptionIveSuspended();
    virtual void handleException();
};
inline
ExceptionIveSuspended::ExceptionIveSuspended()
{
}
class ExceptionEnrollDismissCpu : public ExceptionClass {
    int enrollOrDismiss;
public:
    void enroll();
    void dismiss();
    virtual void handleException();
};
inline void
ExceptionEnrollDismissCpu::enroll()
{
    enrollOrDismiss = 1;
}
inline void
ExceptionEnrollDismissCpu::dismiss()
{
    enrollOrDismiss = 0;
}
# 12 "/usr/local/include/Awe2/CpuMultiplexor.h"
# 1 "/usr/local/include/Awe2/SpinLock.h"
# 1 "/usr/local/include/Awe2/assert.h"
# 42 "/usr/local/include/Awe2/assert.h"
# 16 "/usr/local/include/Awe2/SpinLock.h"
# 1 "/usr/local/include/Awe2/Config.h"
# 21 "/usr/local/include/Awe2/Config.h"
# 17 "/usr/local/include/Awe2/SpinLock.h"
static const char SpinLockFree = '\x00';
static const char SpinLockHeld = '\xff';
class SpinLock {
	int state;	 
	int pCount;
public:
	inline SpinLock();
	inline ~SpinLock();
	void reserve();
	void release();
	int count();
};
inline
SpinLock::SpinLock()
{
	state = SpinLockFree;
	pCount = 0;
}
inline
SpinLock::~SpinLock()
{
	{ if ((state == SpinLockFree)) ; else _assert( "state == SpinLockFree", "/usr/local/include/Awe2/SpinLock.h",43); } ;
}
  inline void
  SpinLock::reserve()
  {
    { if ((state == SpinLockFree)) ; else _assert( "state == SpinLockFree", "/usr/local/include/Awe2/SpinLock.h",50); } ;
    state = ~SpinLockFree;
  }
inline void
SpinLock::release()
{
	{ if ((state != SpinLockFree)) ; else _assert( "state != SpinLockFree", "/usr/local/include/Awe2/SpinLock.h",58); } ;
	state = SpinLockFree;
}
inline int
SpinLock::count()
{
	return pCount;
}
# 13 "/usr/local/include/Awe2/CpuMultiplexor.h"
# 1 "/usr/local/include/Awe2/ThreadContainer.h"
# 1 "/usr/local/include/Awe2/Awesime.h"
# 1 "/usr/local/Gnu/lib/g++-include/stream.h"
# 160 "/usr/local/Gnu/lib/g++-include/stream.h"
# 24 "/usr/local/include/Awe2/Awesime.h"
# 1 "/usr/local/Gnu/lib/g++-include/std.h"
# 225 "/usr/local/Gnu/lib/g++-include/std.h"
# 27 "/usr/local/include/Awe2/Awesime.h"
# 53 "/usr/local/include/Awe2/Awesime.h"
class Awesime;
typedef Awesime *AwesimePtr;
typedef void *VoidPtr;
extern const int SubClassResponsibility;
class Awesime {
protected:
    int debugFlag;
public :
    inline Awesime(bool xdebug = 0) {
	debugFlag = xdebug;
    }
    inline ~Awesime(){};
    virtual bool debug();
    virtual bool debug(bool x);
    virtual void classResetInternalState();
    virtual void classReportState(ostream&);
    virtual void classPrintOn(ostream& s);
    virtual const char* classIsA();
    virtual AwesimePtr classCopy();
    virtual AwesimePtr classDeepCopy();
    virtual void subClassResponsibility(char *name = "");
};
inline ostream&
operator<<(ostream& strm, const Awesime& ob)
{
    ob.classPrintOn(strm);
    return strm;
}
# 10 "/usr/local/include/Awe2/ThreadContainer.h"
class Thread;
class ThreadContainer : public Awesime {
    public :
    inline ThreadContainer(bool xdebug = 0) : (xdebug) {}
    virtual void add( Thread* );
    virtual void add( double when, Thread* );
    virtual void add( int when, Thread* );
    virtual Thread* remove();
    virtual Thread* remove(Thread* toRemove);
    virtual bool isEmpty();
    virtual unsigned size();
};
# 19 "/usr/local/include/Awe2/CpuMultiplexor.h"
class Thread;
class ReserveByException;
class AwesimeHeap;
class SpinLock;
class SpinFetchAndOp;
class CpuMultiplexor;
extern int CpuMultiplexors;
extern CpuMultiplexor *ThisCpu;
extern int CpuMuxDebugFlag;
extern SpinLock CpuCerrLock;
class CpuMultiplexor {
protected:
    Thread *currentThread;
    HardwareContext systemContext;
    ThreadContainer *myCurrentEvents;
    SpinLock *myCurrentEventsLock;
    int *myCurrentEventsCounter;
    SpinFetchAndOp *globalCurrentEventsCounter;
    int iYam;	 
    int pid;	 
    int oldGeneration;  
    char nameSpace[128];
    char *pNameTemplate;
    char *pName;
    int *terminated;
    int enabled;
    Thread *remove();
    void allocateLocalEventStructures(int,int);
    virtual void allocateEventStructures(int,int);
    virtual void deallocateEventStructures();
    void addUnlocked(Thread *);
    void addToAnother(int, Thread *);
    friend class ExceptionReserve;
    friend class ExceptionTerminate;
    friend class ExceptionReschedule;
    friend class ExceptionIveSuspended;
    friend class ExceptionEnrollDismissCpu;
    ExceptionClass *raisedBy;
    ExceptionReserve reserveException;
    ExceptionTerminate terminateException;
    ExceptionReschedule rescheduleException;
    ExceptionIveSuspended iveSuspendedException;
    ExceptionEnrollDismissCpu enrollDismissCpuException;
public:
    void raise(ExceptionClass *);
    void reserveByException( ReserveByException * );
    void threadTerminateException( void ** );
    void flick();
public:
    CpuMultiplexor(int debug = 0);
    virtual ~CpuMultiplexor();
    virtual void fireItUp(int Cpus = 1, unsigned shared = (4196 * 500));
    virtual void warmThePot(int);
    virtual void stirItAround();
    virtual void coolItDown();
    virtual void terminateAll();
    virtual void enrollCpu();
    virtual void dismissCpu();
    virtual void add(Thread *);
    Thread * CurrentThread();
    void debug(int newdebug);
    int debug();
    char *name();
    int cpuId();
};
inline int CpuMultiplexor::cpuId()
{
    return( iYam );
}
inline char *
CpuMultiplexor::name()
{
    return(pName);
}
inline Thread *
CpuMultiplexor::CurrentThread()
{
    return( currentThread );
}
inline void
CpuMultiplexor::addUnlocked(Thread *who)
{
    myCurrentEvents -> add( who );
}
# 1 "/usr/local/include/Awe2/Thread.h"
# 1 "/usr/local/include/Awe2/Awesime.h"
# 92 "/usr/local/include/Awe2/Awesime.h"
# 10 "/usr/local/include/Awe2/Thread.h"
# 1 "/usr/local/include/Awe2/HardwareContext.h"
# 108 "/usr/local/include/Awe2/HardwareContext.h"
# 11 "/usr/local/include/Awe2/Thread.h"
# 1 "/usr/local/include/Awe2/ThreadContainer.h"
# 31 "/usr/local/include/Awe2/ThreadContainer.h"
# 12 "/usr/local/include/Awe2/Thread.h"
# 1 "/usr/local/Gnu/lib/g++-include/stream.h"
# 160 "/usr/local/Gnu/lib/g++-include/stream.h"
# 13 "/usr/local/include/Awe2/Thread.h"
enum ThreadState { SUSPENDED, RUNNING, RUNNABLE, ZOMBIED, TERMINATED };
typedef int ThreadPriority;
class CpuMultiplexor;
class SimulationMultiplexor;
class Thread : public Awesime {
    friend class CpuMultiplexor;
    friend class SimulationMultiplexor;
    HardwareContext pContext;
    ThreadState threadState;
    ThreadPriority threadPriority;
    short cpuAffinity;
    ThreadContainer suspendedOn;
    void startOff();
    void makeTerminated();
    char* threadName;
protected:
    void name(char *);
    void state(ThreadState s);
    void makeRunnable();
    virtual void main();
public:
    Thread(char* name ="", unsigned stacksize = 1010,
	   ThreadPriority priority = 0,
	   int debug = 0, int checkStack = 1);
    virtual ~Thread();
    const HardwareContext * context();
    char* name();
    ThreadState state();
    long maxStackDepth();
    void checkStack();
    void priority(ThreadPriority newPriority);
    ThreadPriority priority();
    virtual void classPrintOn(ostream& strm);
};
inline char*
Thread::name()
{
    return threadName;
}
inline void
Thread::name(char *name)
{
    threadName = name;
}
inline void
Thread::state(ThreadState s)
{
    threadState = s;
}
inline ThreadState
Thread::state()
{
    return threadState;
}
inline long
Thread::maxStackDepth()
{
    return( pContext.maxStackDepth() );
}
inline void
Thread::checkStack()
{
    pContext.checkStack();
}
inline ThreadPriority
Thread::priority()
{
    return(threadPriority);
};
inline void
Thread::priority(ThreadPriority newPriority)
{
    threadPriority = newPriority;
}
# 169 "/usr/local/include/Awe2/CpuMultiplexor.h"
inline void
CpuMultiplexor::reserveByException( ReserveByException *sem )
{
    reserveException.reserve(sem);
    raise( &reserveException );
}
inline void
CpuMultiplexor::threadTerminateException( void **killMe )
{
    terminateException.terminate( killMe );
    raise( &terminateException );
}
inline void
CpuMultiplexor::flick()
{
    rescheduleException.cpu(-1);
    currentThread -> cpuAffinity = -1;
    raise( &rescheduleException ); 
}
inline Thread *
CurrentThread()
{
    return( ThisCpu -> CurrentThread() );
}
inline void
CheckCurrentStack()
{
    CurrentThread() -> checkStack();
}
extern ThreadContainer *AllocateHardwareCurrentEventsStructure();
# 10 "/usr/local/include/Awe2/SimulationMultiplexor.h"
# 1 "/usr/local/include/Awe2/HardwareContext.h"
# 108 "/usr/local/include/Awe2/HardwareContext.h"
# 11 "/usr/local/include/Awe2/SimulationMultiplexor.h"
extern double CurrentSimulatedTime;
extern const double NullTime;
class SpinBarrier;
class TimeSchedulerPQ;
class SimulationMultiplexor : public CpuMultiplexor {
protected:
    TimeSchedulerPQ *myPendingEvents;
    SpinLock *myPendingEventsLock;
    SpinBarrier *cpuBarrier;
    virtual int advanceTime();
    virtual void allocateLocalEventStructures(int,int);
    virtual void allocateEventStructures(int,int);
    virtual void deallocateEventStructures();
public:
    SimulationMultiplexor(int debug = 0, int barrierMaxLoops = 0);
    ~SimulationMultiplexor();
    virtual void warmThePot(int);
    virtual void stirItAround();
    virtual void coolItDown();
    virtual void addAt(Thread *, double);
    virtual void addWithDelay(Thread *, double);
    virtual void hold( double time );
    virtual void await( double time );
};
extern SimulationMultiplexor *ThisSimulationMultiplexor;
inline double simulatedClock() {
    return( CurrentSimulatedTime );
}
inline void await(double till)
{
    if ( till > CurrentSimulatedTime ) {
	ThisSimulationMultiplexor -> await(till);
    }
}
inline void hold(double holdFor)
{
    ThisSimulationMultiplexor -> await( CurrentSimulatedTime + holdFor );
}
# 2 "../Src/Task.cc"
# 1 "../Src/Task.h"
# 1 "/usr/local/include/Awe2/Thread.h"
# 123 "/usr/local/include/Awe2/Thread.h"
# 4 "../Src/Task.h"
# 1 "../Src/Globals.h"
# 1 "/usr/local/include/Awe2/Awesime.h"
# 92 "/usr/local/include/Awe2/Awesime.h"
# 4 "../Src/Globals.h"
# 1 "/usr/local/include/Awe2/SpinLock.h"
# 68 "/usr/local/include/Awe2/SpinLock.h"
# 5 "../Src/Globals.h"
class Node;
class Link;
class Thread;
class LowerBoundedFifo;
class Statistic;
class Facility;
class Barrier;
class Message;
class ostream;
class istream;
static const int MaxDiameter = 7;
static const int MaxNodes = (1 << MaxDiameter);
extern int GlobalNodes;
extern int GlobalDiameter;
extern Barrier *EveryBodyReady;
extern SpinLock DebugFileLock;
extern ostream *DebugFile;
extern SpinLock OutputLock;
extern ostream *Output;
extern SpinLock ErrorLock;
extern ostream *Error;
extern SpinLock SummaryLock;
extern ostream *Summary;
extern bool Debug;
extern bool DebugCpu;
extern Node *GlobalNode[ MaxNodes ];
extern Facility *GlobalWire[ MaxNodes ][ MaxDiameter ];
extern int GlobalWireFlaws;
extern bool GlobalBiDirectionalLinks;
extern char *NodeKind;
extern char *LinkKind;
extern int ServersPerNode;
extern int MallocDebugLevel;
static const int NOTREACHED = 0;
static const int NOTIMPLEMENTED = 0;
# 5 "../Src/Task.h"
# 1 "/usr/local/include/Awe2/Event.h"
# 1 "/usr/local/include/Awe2/ReserveByException.h"
# 1 "/usr/local/include/Awe2/Awesime.h"
# 92 "/usr/local/include/Awe2/Awesime.h"
# 10 "/usr/local/include/Awe2/ReserveByException.h"
class ExceptionReserve;
class Thread;
class ReserveByException : public Awesime {
    friend class ExceptionReserve;
private:
    virtual bool reserveByException(Thread *byWho);
public:
    ReserveByException(bool debug = FALSE);
};
inline
ReserveByException::ReserveByException(bool debug) : (debug)
{
}
# 15 "/usr/local/include/Awe2/Event.h"
# 1 "/usr/local/include/Awe2/FifoScheduler.h"
# 1 "/usr/local/include/Awe2/ThreadContainer.h"
# 31 "/usr/local/include/Awe2/ThreadContainer.h"
# 10 "/usr/local/include/Awe2/FifoScheduler.h"
# 1 "/usr/local/include/Awe2/AwesimeFifo.h"
# 1 "/usr/local/include/Awe2/GenericFifo.h"
# 1 "/usr/local/include/Awe2/Awesime.h"
# 92 "/usr/local/include/Awe2/Awesime.h"
# 16 "/usr/local/include/Awe2/GenericFifo.h"
# 1 "/usr/local/include/Awe2/Generic.h"
# 51 "/usr/local/include/Awe2/Generic.h"
# 17 "/usr/local/include/Awe2/GenericFifo.h"
typedef AwesimePtr  AwesimeFifoItem  ;
typedef unsigned short  AwesimeFifoIndex  ;
class AwesimeFifo  : public Awesime  {
    AwesimeFifoItem   *list;
    AwesimeFifoIndex   allocatedSize;
    AwesimeFifoIndex   listHead;
    AwesimeFifoIndex   listTail;
    char *pValid;
    unsigned int listElements;
    inline AwesimeFifoIndex   advance(AwesimeFifoIndex   i) {
	return( ((i+1) >= allocatedSize) ? (0) : (i+1) );
    }
public:
    inline AwesimeFifo (int defaultLength = 0, bool xdebug = 0) : (xdebug) {
	listHead = listTail = 0;
	listElements = 0;
	allocatedSize = 0;
	list = 0;
	pValid = 0;
	if (defaultLength > 0) {
	    reSize(defaultLength);
	}
    }
    virtual ~AwesimeFifo ();
    void reSize(int howMany);
    virtual void add(AwesimeFifoItem   *t);
    virtual bool remove(AwesimeFifoItem   *item);
    virtual bool removeIfFound(AwesimeFifoItem  * item);
    virtual bool doStart( AwesimeFifoIndex   &index,
			 AwesimeFifoItem  * item);
    virtual bool doDelete(AwesimeFifoIndex   &index);
    virtual bool doNext( AwesimeFifoIndex   &index,
			AwesimeFifoItem  * item);
    virtual void doDone();
    inline bool valid(AwesimeFifoIndex   index) {
	return ( pValid[index] );
    }
    inline AwesimeFifoItem   & item(AwesimeFifoIndex   i) {
	return( list[i] );
    }
    inline AwesimeFifoIndex   maxIndex() {
	return(allocatedSize);
    }
    virtual bool isEmpty();
    virtual unsigned int size();
    virtual void classPrintOn(ostream& s);
    virtual const char* classIsA();
};
# 13 "/usr/local/include/Awe2/AwesimeFifo.h"
# 11 "/usr/local/include/Awe2/FifoScheduler.h"
class Thread;
class FifoScheduler : public ThreadContainer {
    AwesimeFifo fifo;
public:
    FifoScheduler(int defaultLength = 0, bool xdebug = 0);
    virtual void add(Thread *t);
    virtual void add(double when, Thread *t);
    virtual Thread* remove();
    virtual Thread* remove(Thread*);
    virtual bool isEmpty();
    virtual unsigned size();
    virtual void classPrintOn(ostream& s);
};
# 16 "/usr/local/include/Awe2/Event.h"
# 1 "/usr/local/include/Awe2/SpinLock.h"
# 68 "/usr/local/include/Awe2/SpinLock.h"
# 17 "/usr/local/include/Awe2/Event.h"
class Event : public ReserveByException {
    SpinLock lock;
    short garcon;
    short generation;
    short pLoops;
    FifoScheduler pPileOfThreads;
    void releaseAll();
private:
    virtual bool reserveByException(Thread *byWho);
public:
    Event(int loops = 0);
    virtual ~Event();
    int size();
    void waitFor();
    void trigger();
    virtual void classPrintOn(ostream&);
};
inline
Event::Event(int l)
{
    garcon = 0;
    generation = 0;
    pLoops = l;
}
# 6 "../Src/Task.h"
# 1 "/usr/local/include/Awe2/Semaphore.h"
# 1 "/usr/local/include/Awe2/ReserveByException.h"
# 31 "/usr/local/include/Awe2/ReserveByException.h"
# 25 "/usr/local/include/Awe2/Semaphore.h"
# 1 "/usr/local/include/Awe2/SpinLock.h"
# 68 "/usr/local/include/Awe2/SpinLock.h"
# 26 "/usr/local/include/Awe2/Semaphore.h"
# 1 "/usr/local/include/Awe2/ThreadContainer.h"
# 31 "/usr/local/include/Awe2/ThreadContainer.h"
# 27 "/usr/local/include/Awe2/Semaphore.h"
class Semaphore : public ReserveByException {
protected:
    SpinLock lock;
    ThreadContainer *pScheduler;
    int pCount;
private:
    virtual bool reserveByException( Thread *byWho );
public :
    Semaphore(int count = 1,
	      ThreadContainer *scheduler = 0,
	      bool debug = FALSE);
    virtual ~Semaphore();
    virtual void reserve();
    virtual void release();
    virtual bool reserveNoBlock();
    virtual unsigned size();
    virtual int count();
    virtual int count(int count);
    virtual void incrCount(int increment);
    bool isEmpty();
    virtual void classPrintOn(ostream&);
};
inline bool
Semaphore::isEmpty()
{
    return( size() == 0);
}
# 7 "../Src/Task.h"
class Task;
class RecordFifo;
class Task;
extern int GlobalTotalTasks;
extern Task **GlobalTask;
class Task : public Thread {
protected:
    char nameStr[64];
    double born;
    protected: int pid ; void id(int);public: int id() ;
    protected: Task * pparent ; void parent(Task *);public: Task * parent() ;
    protected: int plevel ; void level(int);public: int level() ;
    protected: Message * pmessages ; void messages(Message *);public: Message * messages() ;
    protected: Task * pnodeChain ;public: Task * nodeChain(); void nodeChain(Task *) ;
    protected: int pnodeNumber ;public: int nodeNumber(); void nodeNumber(int) ;
protected:
    Semaphore messagesLock;
    int waitingFor;
    Event messagesEvent;
    RecordFifo *record;
    Node *node;
    int pDebug;
    char pNameStr[32];
    virtual Message *recv( int what );
    virtual void send( int toPid, int what, int size );
public:
    Task(int node, int id, Task *parent, int level, bool debug);
    virtual void main();
    virtual void delivery( Message * );
};
inline int Task::id(){ return( pid  );} inline void Task::id(int x){ pid  = x;} ;
inline Task * Task::parent(){ return( pparent  );} inline void Task::parent(Task * x){ pparent  = x;} ;
inline int Task::level(){ return( plevel  );} inline void Task::level(int x){ plevel  = x;} ;
inline Message * Task::messages(){ return( pmessages  );} inline void Task::messages(Message * x){ pmessages  = x;} ;
inline Task * Task::nodeChain(){ return( pnodeChain  );} inline void Task::nodeChain(Task * x){ pnodeChain  = x;} ;
inline int Task::nodeNumber(){ return( pnodeNumber  );} inline void Task::nodeNumber(int x){ pnodeNumber  = x;} ;
# 3 "../Src/Task.cc"
# 1 "../Src/Node.h"
# 1 "../Src/Globals.h"
# 102 "../Src/Globals.h"
# 4 "../Src/Node.h"
# 1 "/usr/local/include/Awe2/SpinLock.h"
# 68 "/usr/local/include/Awe2/SpinLock.h"
# 5 "../Src/Node.h"
class Task;
class ForkRequest;
class Node {
protected:
    Facility *cpu;
    virtual double workload();
protected:
    LowerBoundedFifo *messages;
protected:
    Link *links[ MaxDiameter ];
    bool routeExists[ MaxNodes ];
    protected: int punroutable ;public: int unroutable(); void unroutable(int) ;
protected:
private:
    char pNameStr[32];
    protected: char * pname ; void name(char *);public: char * name() ;
    protected: int pnodeNumber ; void nodeNumber(int);public: int nodeNumber() ;
protected:
    SpinLock tasksLock;
    protected: int pnumberOfTasks ; void numberOfTasks(int);public: int numberOfTasks() ;
    protected: Task * ptasks ; void tasks(Task *);public: Task * tasks() ;
protected:
    virtual void createLinks();
    virtual int selectNode();
    virtual bool findRoute(int, int, int);
public:
    Node(int node);
    ~Node();
    Link *link(int);
    virtual void enroll( Task * );
    virtual void fork( ForkRequest * );
    virtual void compute(Task *, double);
    virtual void dismiss( Task * );
    virtual void send( Message*);
    virtual void enqueue( Message*);
    virtual void recv( Message*);
    virtual Message *shipOut();
    virtual bool checkConnectivity();
};
inline int Node::numberOfTasks(){ return( pnumberOfTasks  );} inline void Node::numberOfTasks(int x){ pnumberOfTasks  = x;} ;
inline char * Node::name(){ return( pname  );} inline void Node::name(char * x){ pname  = x;} 
inline int Node::nodeNumber(){ return( pnodeNumber  );} inline void Node::nodeNumber(int x){ pnodeNumber  = x;} 
inline Task * Node::tasks(){ return( ptasks  );} inline void Node::tasks(Task * x){ ptasks  = x;} 
inline int Node::unroutable(){ return( punroutable  );} inline void Node::unroutable(int x){ punroutable  = x;} ;
inline Link *
Node::link(int n)
{
    return(links[n]);
}
static int NodeBounds(int node)
{
    { if (( node > -1 && node < GlobalNodes )) ; else _assert( "node > -1 && node < GlobalNodes", "../Src/Node.h",82); } ;
}
# 4 "../Src/Task.cc"
# 1 "../Src/Globals.h"
# 102 "../Src/Globals.h"
# 5 "../Src/Task.cc"
# 1 "../Src/RecordFifo.h"
# 1 "/usr/local/include/Awe2/LockedFifo.h"
# 1 "/usr/local/include/Awe2/Semaphore.h"
# 70 "/usr/local/include/Awe2/Semaphore.h"
# 10 "/usr/local/include/Awe2/LockedFifo.h"
# 1 "/usr/local/include/Awe2/AwesimeFifo.h"
# 15 "/usr/local/include/Awe2/AwesimeFifo.h"
# 11 "/usr/local/include/Awe2/LockedFifo.h"
class LockedFifo : public AwesimeFifo {
protected:
    Semaphore fifoLock;
public:
    inline LockedFifo(int defaultLength = 0)
	: (defaultLength), fifoLock(1) {
	}
    virtual void add(AwesimeFifoItem *t);
    virtual bool remove(AwesimeFifoItem *item);
    virtual bool removeIfFound(AwesimeFifoItem* item);
    virtual bool doStart( AwesimeFifoIndex& index, AwesimeFifoItem* item);
    virtual void doDone();
    virtual unsigned int size();
    virtual void classPrintOn(ostream& s);
};
# 4 "../Src/RecordFifo.h"
# 1 "../Src/WorkRecord.h"
# 1 "/usr/local/include/Awe2/Awesime.h"
# 92 "/usr/local/include/Awe2/Awesime.h"
# 4 "../Src/WorkRecord.h"
enum WorkKind {
    WorkTime,
    WorkBorn,
    WorkCompute,
    WorkFork,
    WorkJoin,
    WorkSend,
    WorkRecv,
    WorkDie
    };
class WorkRecord : public Awesime {
    WorkKind pKind;
    union {
	double howLong;
	int who;
	WorkRecord *next;  
    } un;
    int messageNumber;
    int messageSize;
public:
    WorkRecord(WorkKind kind);
    WorkRecord(WorkKind kind, double howLong);
    WorkRecord(WorkKind kind, int who);
    WorkRecord(WorkKind kind, int who, int msg);
    WorkRecord(WorkKind kind, int who, int msg, int size);
    WorkRecord *operator new(long);
    void operator delete(void *);
    WorkRecord *next();
    void next(WorkRecord *);
    WorkKind kind();
    void kind(WorkKind);
    double howLong();
    int who();
    int what();
    int size();
    virtual void classPrintOn(ostream& s);
};
inline WorkRecord *
WorkRecord::next()
{
    return(un.next);
}
inline void
WorkRecord::next(WorkRecord * n)
{
    un.next = n;
}
inline WorkKind
WorkRecord::kind()
{
    return(pKind);
}
inline void
WorkRecord::kind(WorkKind n)
{
    pKind = n;
}
inline double
WorkRecord::howLong()
{
     return( un.howLong );
}
inline int
WorkRecord::who()
{
     return( un.who );
}
inline int
WorkRecord::what()
{
     return( messageNumber );
}
inline int
WorkRecord::size()
{
     return( messageSize );
}
# 5 "../Src/RecordFifo.h"
class RecordFifo : public LockedFifo {
    bool buildRecord;
    double lastRecord;
    WorkKind lastAction;
    double lastComputeTime;
    double lastComputeStart;
    bool pendingCompute;
    void preRecord();
public:
    RecordFifo( bool build = TRUE );
    void born( int );
    void fork( int );
    void join( int );
    void send( int, int msg, int size);
    void recv( int, int msg);
    void compute( double );
    void die ();
};
# 6 "../Src/Task.cc"
# 1 "../Src/WorkRecord.h"
# 101 "../Src/WorkRecord.h"
# 7 "../Src/Task.cc"
# 1 "../Src/ReadCompact.h"
extern int GlobalTotalTasks;
extern int GlobalTotalMessages;
class RecordFifo;
extern RecordFifo **GlobalRecords;
void ReadCompact(     struct _iobuf  * );
# 8 "../Src/Task.cc"
# 1 "../Src/ForkRequest.h"
# 1 "../Src/Globals.h"
# 102 "../Src/Globals.h"
# 4 "../Src/ForkRequest.h"
class Task;
class ForkRequest;
class ForkRequest {
protected:
    protected: int pwho ; void who(int);public: int who() ;
    protected: Task * pparent ; void parent(Task *);public: Task * parent() ;
    protected: int plevel ; void level(int);public: int level() ;
    protected: int pdebug ; void debug(int);public: int debug() ;
    protected: ForkRequest * pnext ;public: ForkRequest * next(); void next(ForkRequest *) ;
protected:
    void allocate();
public:
    ForkRequest(int who, Task *parent, int level, int debug );
    ~ForkRequest();
};
inline int ForkRequest::who(){ return( pwho  );} inline void ForkRequest::who(int x){ pwho  = x;} ;
inline Task * ForkRequest::parent(){ return( pparent  );} inline void ForkRequest::parent(Task * x){ pparent  = x;} ;
inline int ForkRequest::level(){ return( plevel  );} inline void ForkRequest::level(int x){ plevel  = x;} ;
inline int ForkRequest::debug(){ return( pdebug  );} inline void ForkRequest::debug(int x){ pdebug  = x;} ;
inline ForkRequest * ForkRequest::next(){ return( pnext  );} inline void ForkRequest::next(ForkRequest * x){ pnext  = x;} 
# 9 "../Src/Task.cc"
# 1 "../Src/Message.h"
# 1 "/usr/local/include/Awe2/Awesime.h"
# 92 "/usr/local/include/Awe2/Awesime.h"
# 4 "../Src/Message.h"
# 1 "../Src/Globals.h"
# 102 "../Src/Globals.h"
# 5 "../Src/Message.h"
class Task;
class Load;
typedef enum {MessageSingle, MessageBroadcast} MessageCategory;
class Message {
    protected: int ptoNode ;public: int toNode(); void toNode(int) ;
    protected: int pfromNode ; void fromNode(int);public: int fromNode() ;
    protected: int ptoPid ; void toPid(int);public: int toPid() ;
    protected: Task * ptoTask ; void toTask(Task *);public: Task * toTask() ;
    protected: int pfromPid ; void fromPid(int);public: int fromPid() ;
    protected: MessageCategory pcategory ; void category(MessageCategory);public: MessageCategory category() ;
    protected: int pstage ; void stage(int);public: int stage() ;
    protected: char * pbody ; void body(char *);public: char * body() ;
    protected: int psize ; void size(int);public: int size() ;
    protected: int pid ; void id(int);public: int id() ;
    protected: double ptimeSent ;public: double timeSent(); void timeSent(double) ;
    protected: Load * pload ;public: Load * load(); void load(Load *) ;
    protected: Message * pnext ;public: Message * next(); void next(Message *) ;
    protected: double pwhen ;public: double when(); void when(double) ;
    protected: int pcheck ; void check(int);public: int check() ;
public:
    Message();
    Message(int fromPid, int fromNode, int id,
	    int toPid, int toNode, Task *toTask,
	    char *body, int size );
    Message *operator new(long);
    void operator delete(void *);
    void classPrintOn(ostream&);
};
inline ostream&
operator<<(ostream& strm, const Message& ob)
{
    ob.classPrintOn(strm);
    return strm;
}
inline int Message::toNode(){ return( ptoNode  );} inline void Message::toNode(int x){ ptoNode  = x;} 
inline int Message::fromNode(){ return( pfromNode  );} inline void Message::fromNode(int x){ pfromNode  = x;} 
inline int Message::id(){ return( pid  );} inline void Message::id(int x){ pid  = x;} 
inline Task * Message::toTask(){ return( ptoTask  );} inline void Message::toTask(Task * x){ ptoTask  = x;} 
inline int Message::toPid(){ return( ptoPid  );} inline void Message::toPid(int x){ ptoPid  = x;} 
inline int Message::fromPid(){ return( pfromPid  );} inline void Message::fromPid(int x){ pfromPid  = x;} 
inline MessageCategory Message::category(){ return( pcategory  );} inline void Message::category(MessageCategory x){ pcategory  = x;} 
inline int Message::stage(){ return( pstage  );} inline void Message::stage(int x){ pstage  = x;} 
inline char* Message::body(){ return( pbody  );} inline void Message::body(char* x){ pbody  = x;} 
inline int Message::size(){ return( psize  );} inline void Message::size(int x){ psize  = x;} 
inline double Message::timeSent(){ return( ptimeSent  );} inline void Message::timeSent(double x){ ptimeSent  = x;} 
inline Load * Message::load(){ return( pload  );} inline void Message::load(Load * x){ pload  = x;} 
inline Message * Message::next(){ return( pnext  );} inline void Message::next(Message * x){ pnext  = x;} 
inline double Message::when(){ return( pwhen  );} inline void Message::when(double x){ pwhen  = x;} 
inline int Message::check(){ return( pcheck  );} inline void Message::check(int x){ pcheck  = x;} 
# 10 "../Src/Task.cc"
Task **GlobalTask;
int GlobalTotalTasks;
RecordFifo **GlobalRecords;
Task::Task(int xnode, int xid, Task *xparent, int xlevel, bool xdebug)
    : ("Task", 5000, 0, 0, 1), messagesEvent(0)
{
    nodeNumber(xnode);
    id(xid);
    parent(xparent);
    level(xlevel);
    pDebug = xdebug;
    { if (( id() >= 0 && id () <= GlobalTotalTasks )) ; else _assert( "id() >= 0 && id () <= GlobalTotalTasks", "../Src/Task.cc",40); } ;
    GlobalTask[ id() ] = this;
    record = GlobalRecords[ id() ];
    sprintf(pNameStr, "[Task-%d]	", id() );
    name(pNameStr);
    node = GlobalNode[ nodeNumber() ];
    nodeChain(0);
    node -> enroll( this );
    messages(0);
    waitingFor = -1;
    if ( Debug && DebugFile ) { DebugFileLock.reserve() ;
    (*DebugFile) << name() << "I am born\n";
    DebugFile -> flush(); DebugFileLock.release();} ;
}
void
Task::main()
{
    for(;;) {
	WorkRecord *rec;
	bool gotOne = record -> remove( (AwesimeFifoItem *) &rec );
	if (!gotOne) {
	    if ( Debug && DebugFile ) { DebugFileLock.reserve() ;
	    (*DebugFile) << name() << "Nothing to do!\n";
	    DebugFile -> flush(); DebugFileLock.release();} ;
	    return;
	}
	if ( Debug && DebugFile ) { DebugFileLock.reserve() ;
	(*DebugFile) << name() << "Process " << *rec;
	DebugFile -> flush(); DebugFileLock.release();} ;
	switch (rec -> kind()) {
	case WorkBorn: 
	    break;
	case WorkCompute: 
	    node -> compute( this, rec -> howLong() );
	    break;
	case WorkFork:
	    node -> fork( new ForkRequest( rec -> who(), this,
					  level() + 1, pDebug) );
	    break;
	case WorkSend:
	    send( rec -> who(), rec -> what(), rec -> size() );
	    break;
	case WorkRecv:
	{
	    Message *msg = recv( rec -> what() );
	    delete(msg);
	}
	    break;
	case WorkJoin: 
	    break;
	case WorkDie: 
	    node -> dismiss( this );
	    if ( Debug && DebugFile ) { DebugFileLock.reserve() ;
	    (*DebugFile) << name() << "Die at " << simulatedClock() << "\n";
	    DebugFile -> flush(); DebugFileLock.release();} ;
	    if ( Output ) { OutputLock.reserve() ;
	    (*Output) << name() << "Die at " << simulatedClock() << "\n";
	    Output -> flush(); OutputLock.release();} ;
	    return;
	case WorkTime:
	default:
	    break;
	}
	delete rec;
    }
}
void
Task::delivery( Message *newMsg )
{
    if ( Debug && DebugFile ) { DebugFileLock.reserve() ;
    (*DebugFile) << name() << "Deliver message " << *newMsg <<"\n";
    DebugFile -> flush(); DebugFileLock.release();} ;
    messagesLock.reserve();
    newMsg -> next( messages() );
    messages( newMsg );
    if ( newMsg -> id() == waitingFor ) {
	messagesEvent.trigger();
    }
    messagesLock.release();
}
Message *
Task::recv( int what )
{
    if ( Debug && DebugFile ) { DebugFileLock.reserve() ;
    (*DebugFile) << name() << "Wait for message #" << what <<"\n";
    DebugFile -> flush(); DebugFileLock.release();} ;
    for(;;) {
	messagesLock.reserve();
	Message *msg = messages();
	Message *follow = 0;
	while ( msg && msg -> id() != what ) {
	    { if (( msg -> toNode() != -1 )) ; else _assert( "msg -> toNode() != -1", "../Src/Task.cc",157); } ;
	    { if (( follow == 0 || follow -> next() == msg )) ; else _assert( "follow == 0 || follow -> next() == msg", "../Src/Task.cc",158); } ;
	    follow = msg;
	    msg = msg -> next();
	}
	if ( msg && msg -> id() == what ) {
	    Message *nxt = msg -> next();
	    { if (( nxt == 0 || nxt -> toNode() != -1 )) ; else _assert( "nxt == 0 || nxt -> toNode() != -1", "../Src/Task.cc",165); } ;
	    if ( follow == 0 ) {			 
		messages( nxt );
	    }
	    else {
		{ if (( follow -> next() == msg )) ; else _assert( "follow -> next() == msg", "../Src/Task.cc",170); } ;
		follow -> next( nxt );	 
	    }
	    messagesLock.release();
	    msg -> next(0);
	    return( msg );
	}
	waitingFor = what;
	messagesLock.release();
	if ( Debug && DebugFile ) { DebugFileLock.reserve() ;
	(*DebugFile) << name() << "Didn't find it, wait for new messages\n";
	DebugFile -> flush(); DebugFileLock.release();} ;
	messagesEvent.waitFor();  
    }
    return( 0 );
}
void
Task::send(int toPid, int what, int size)
{
    Task *task = GlobalTask[ toPid ];
    Message *msg = new Message(id(), nodeNumber(), what,
			       toPid, 0, task,
			       0, size);
    GlobalNode[ nodeNumber() ] -> send( msg );
}
bug in operator delete
#1811
Author: Michael Tiemann
Date: Sun, 02 Apr 1989 09:58
54 lines
2447 bytes
   This appears in g++ 1.34.1 for an Encore and also a Sun-3/60 w/SunOS4.0.1.
   
   I have a class (Message) that declares
   
       void operator delete(void *);
   
   and class Task uses this when deleting items. However, g++ gives me a
   message " `this' has no member function named delete". Other classes with
   `operator delete' work with no problems.
   
   When I run c++ using gdb, I find that this message is from cplus-class.c,
   line 2512:
	 if (field == NULL_TREE)
	   {
	     error ("`this' has no member named `%s'", err_name);
   
   If this is indeed a bug, I'd appreciate a patch if one is available.
   
Here's what is happening: GNU C++ thinks that operator delete is like
a member function.  Hence, when you call it, it takes a this pointer
in addition to the pointer which is being deleted.  When called from a
destructor, the address being deleted and the this pointer are the
same.  When called from other than a member function, they may be
different.  In the case you have here, GNU C++ is trying to call

	this->Task::operator delete (msg);

which is not at all what you want.  You can fix this is one of three ways:

	(1) msg->operator delete (msg);
	(2) define a destructor for class Message
	(3) fix GNU C++:

Change this code in cplus-method.c:

      rval = build_method_call (xarg1,
				get_identifier ("op$delete_expr"),
				build_tree_list (NULL_TREE, xarg2), 1, 1);
      /* This happens when the user mis-declares `operator delete'.  */

to this:

      rval = build_method_call (xarg2,
				get_identifier ("op$delete_expr"),
				build_tree_list (NULL_TREE, xarg2), 1, 1);
      /* This happens when the user mis-declares `operator delete'.  */

I guess that since operator delete is really a static member function
(and hence does not take a this parameter, the right fix is to modify
GNU C++ as I have shown for the time being, and I will fix it right
for 1.34.2.

Michael
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads