Operating System - Linux
1752587 Members
4256 Online
108788 Solutions
New Discussion

std::vector allocation limit using aCC in 64-bit mode

 
Simon Munday
New Member

std::vector allocation limit using aCC in 64-bit mode

I have run into a limit on the size that I can allocate a std::vector in code compiled with aCC (A.03.56) on a 64-bit PA-RISC machine. Looking at the STL source code () it seems to only allow me to allocate up to UINT_MAX bytes, and UINT_MAX is defined as 2^32 in limits.h. This makes sense in 32-bit mode, but it also seems to apply in 64-bit mode (i.e. when I compile with +DD64), where I would expect the limit to be 2^64bytes. Does anyone know anything about this, e.g. is there a compiler flag I don't know about that works around this? Or is this a bug? If so, has it been fixed in a later aCC release? Or is there a perfectly good reason for this limit to be in place?
Thanks
Simon
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: std::vector allocation limit using aCC in 64-bit mode

Hmm, I've seen the UINT_MAX limit but assumed it was only limiting std::strings.
The place you found in is allocator::max_size()?

I suggest you contact the Response Center and file a bug report.

Note you can't really allocate 2**64.
To workaround this, you would have to make your own copy of <memory>.