Mail Archives: djgpp/2002/10/08/10:31:42
From: | "Ed Manlove" <emanlove AT ieee DOT org>
|
Newsgroups: | comp.os.msdos.djgpp
|
References: | <E1ko9.403$Od5 DOT 125528170 AT news DOT netcarrier DOT net>
|
Subject: | Re: `operator new' takes type `size_t' as first parameter Revisited
|
Lines: | 420
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.00.2615.200
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2615.200
|
Message-ID: | <upBo9.411$Ed6.129270896@news.netcarrier.net>
|
Date: | Tue, 8 Oct 2002 10:20:52 -0400
|
NNTP-Posting-Host: | 207.207.243.194
|
X-Complaints-To: | news AT netcarrier DOT com
|
X-Trace: | news.netcarrier.net 1034085082 207.207.243.194 (Tue, 08 Oct 2002 09:51:22 EDT)
|
NNTP-Posting-Date: | Tue, 08 Oct 2002 09:51:22 EDT
|
Organization: | NetCarrier Internet Services
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Here is the outputfile tinfo.ii in full
----------------------------------------------------------------------------
------------------------------------
# 1 "../../gcc/cp/tinfo.cc"
#pragma implementation "typeinfo"
# 1 "include/stddef.h" 1
extern "C" {
# 1 "c:/djgpp/include/sys/djtypes.h" 1 3
# 9 "include/stddef.h" 2
typedef int ptrdiff_t;
typedef long unsigned int size_t;
}
# 30 "../../gcc/cp/tinfo.cc" 2
# 1 "../../gcc/cp/tinfo.h" 1
# 1 "include/typeinfo" 1
#pragma interface "typeinfo"
# 1 "include/exception" 1
#pragma interface "exception"
extern "C++" {
namespace std {
class exception {
public:
exception () { }
virtual ~exception () { }
virtual const char* what () const;
};
class bad_exception : public exception {
public:
bad_exception () { }
virtual ~bad_exception () { }
};
typedef void (*terminate_handler) ();
typedef void (*unexpected_handler) ();
terminate_handler set_terminate (terminate_handler);
void terminate () __attribute__ ((__noreturn__));
unexpected_handler set_unexpected (unexpected_handler);
void unexpected () __attribute__ ((__noreturn__));
bool uncaught_exception ();
}
}
# 9 "include/typeinfo" 2
extern "C++" {
namespace std {
class type_info {
private:
type_info& operator= (const type_info&);
type_info (const type_info&);
protected:
explicit type_info (const char *n): _name (n) { }
const char *_name;
public:
virtual ~type_info ();
bool before (const type_info& arg) const;
const char* name () const
{ return _name; }
bool operator== (const type_info& arg) const;
bool operator!= (const type_info& arg) const;
};
inline bool type_info::
operator!= (const type_info& arg) const
{
return !operator== (arg);
}
class bad_cast : public exception {
public:
bad_cast() { }
virtual ~bad_cast() { }
};
class bad_typeid : public exception {
public:
bad_typeid () { }
virtual ~bad_typeid () { }
};
}
}
# 4 "../../gcc/cp/tinfo.h" 2
struct __user_type_info : public std::type_info {
__user_type_info (const char *n) : type_info (n) {}
virtual void* dcast (const type_info &, int, void *,
const type_info * = 0, void * = 0) const;
};
class __si_type_info : public __user_type_info {
const __user_type_info &base;
public:
__si_type_info (const char *n, const __user_type_info &b)
: __user_type_info (n), base (b) { }
virtual void *dcast (const type_info &, int, void *,
const type_info * = 0, void * = 0) const;
};
typedef unsigned int USItype __attribute__ ((mode (SI)));
struct __class_type_info : public __user_type_info {
enum access { PUBLIC = 1, PROTECTED = 2, PRIVATE = 3 };
struct base_info {
const __user_type_info *base;
USItype offset: 29;
bool is_virtual: 1;
enum access access: 2;
};
const base_info *base_list;
size_t n_bases;
__class_type_info (const char *name, const base_info *bl, size_t bn)
: __user_type_info (name), base_list (bl), n_bases (bn) {}
virtual void* dcast (const type_info &, int, void *,
const type_info * = 0, void * = 0) const;
};
# 31 "../../gcc/cp/tinfo.cc" 2
# 1 "include/new" 1
#pragma interface "new"
extern "C++" {
namespace std {
class bad_alloc : public exception {
public:
virtual const char* what() const throw() { return "bad_alloc"; }
};
struct nothrow_t {};
extern const nothrow_t nothrow;
typedef void (*new_handler)();
new_handler set_new_handler (new_handler);
}
void *operator new (size_t) throw (std::bad_alloc);
void *operator new[] (size_t) throw (std::bad_alloc);
void operator delete (void *) throw();
void operator delete[] (void *) throw();
void *operator new (size_t, const std::nothrow_t&) throw();
void *operator new[] (size_t, const std::nothrow_t&) throw();
void operator delete (void *, const std::nothrow_t&) throw();
void operator delete[] (void *, const std::nothrow_t&) throw();
inline void *operator new(size_t, void *place) throw() { return place; }
inline void *operator new[](size_t, void *place) throw() { return place; }
}
# 32 "../../gcc/cp/tinfo.cc" 2
std::type_info::
~type_info ()
{ }
bool std::type_info::
operator== (const std::type_info& arg) const
{
return (&arg == this) || (strcmp (name (), arg.name ()) == 0);
}
extern "C" void
__rtti_class (void *addr, const char *name,
const __class_type_info::base_info *bl, size_t bn)
{ new (addr) __class_type_info (name, bl, bn); }
extern "C" void
__rtti_si (void *addr, const char *n, const std::type_info *ti)
{
new (addr) __si_type_info
(n, static_cast <const __user_type_info &> (*ti));
}
extern "C" void
__rtti_user (void *addr, const char *name)
{ new (addr) __user_type_info (name); }
void * __user_type_info::
dcast (const type_info& to, int, void *addr, const type_info *, void *)
const
{ return (*this == to) ? addr : 0; }
void * __si_type_info::
dcast (const type_info& to, int require_public, void *addr,
const type_info *sub, void *subptr) const
{
if (*this == to)
return addr;
return base.dcast (to, require_public, addr, sub, subptr);
}
void* __class_type_info::
dcast (const type_info& desired, int is_public, void *objptr,
const type_info *sub, void *subptr) const
{
if (*this == desired)
return objptr;
void *match_found = 0;
for (size_t i = 0; i < n_bases; i++)
{
if (is_public && base_list[i].access != PUBLIC)
continue;
void *p = (char *)objptr + base_list[i].offset;
if (base_list[i].is_virtual)
p = *(void **)p;
p = base_list[i].base->dcast (desired, is_public, p, sub, subptr);
if (p)
{
if (match_found == 0)
match_found = p;
else if (match_found != p)
{
if (sub)
{
const __user_type_info &d =
static_cast <const __user_type_info &> (desired);
void *os = d.dcast (*sub, 1, match_found);
void *ns = d.dcast (*sub, 1, p);
if (os == ns)
;
else if (os == subptr)
continue;
else if (ns == subptr)
{
match_found = p;
continue;
}
}
return 0;
}
}
}
return match_found;
}
- Raw text -