Patches item #796641, was opened at 2003-08-28 12:22
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=307869&aid=796641&group_id=7869
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jonathan Wakely (redi)
Assigned to: Nobody/Anonymous (nobody)
Summary: Prevent warnings from Allocator
Initial Comment:
A comment in Allocator.h claims Allocator is an
Abstract Base Class. It isn't, because it has no
virtual functions, let alone pure virtuals. All it's
methods are static, which means derived classes can't
even override its functions and behave polymorphically.
Since the static functions on the Allocator base class
are useless (they don't do anything) and since the
dynamic (i.e. real) type of derived allocator is always
known when allocate() or deallocate() is called there
is no benefit to having those functions also defined in
the base class. They aren't invoked via a virtual table
(they're static and there is no vtable) and are always
hidden by the derived class' overloads and don't have
any effect except increasing the size of object files.
This patch removes the functions from the base class,
so it provides nothing more than a couple of typedefs
(like std::iterator). It also changes the cpointer
typedefs to use the base-class' definition so they
don't need to be changed if the base class changes (to
for example, const T_cobj*).
It also comments out the names of a couple of unused
variables to prevent compiler warnings.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=307869&aid=796641&group_id=7869
|