Hello,
I'm writing an application that operates on images using Visual C++ 7.1.
Since it should be able to handle many different kinds of pixel formats,
I wrote a color class template like
template<typename T>
class Color {
T rgb[3];
};
The images are vectors of colors like
std::vector< Color<unsigned char> > image;
This seems to work fine for small images, but larger ones (ie. 10 images
at 1024x1024) tend to result in application crashes when an image is
destroyed. An "unhandled exception: user breakpoint" appears in
ntdll.dll, the last known function on the call stack is
std::_Destroy_range() (defined in xmemory). Another common error are bad
alloc exceptions (caused by the operator new on vector.push_back()
calls), even though only about 100mb (on a 1gb machine) are allocated.
Does VC7.1 have a problem with large numbers of tiny objects? The Color
class does not introduce any size overhead compared to a simple array of
built-in types, so I wonder wether there are any other limitations.
Malte