[ Home | CW Bug Reports | Mail ]
MSL simple_allocator::allocate()での不要な code size増加
Subject: BUG -- MSL C++ simple_allocator unnecessary code bloat
---------------------------------------------------------------------------
METROWERKS PRODUCT AND USAGE SECTION
Product name : [ CodeWarrior Professional ]
Product version : [ Pro 4 ]
Component name : [ MSL 4.1.05]
Generating: [ Mac OS 68K / Mac OS PowerPC ]
Purpose: [ any ]
---------------------------------------------------------------------------
BUG DESCRIPTION SECTION
Reason for this report: [ unnecessary code bloat ]
Bug severity: [ cosmetic problem ]
Reproducibility: [ always ]
Problem summary:
simple_allocator::allocate() in MSL C++ "memory" doesn't need NULL
checking. ::operator new() throws the bad_alloc beforehand. This
introduces unnecessary code bloat.
pointer allocate (size_type n,
typename simple_allocator<void>::const_pointer hint = 0)
{
hint; // hh 971227 silence unused warning
T* tmp = (T*)(::operator new ((size_t)(n*sizeof (T))));
/// if (tmp == 0)
/// THROW_BAD_ALLOC;
return tmp;
}
この Pageは MacOS X + Radio UserLand で作っています。