George
Mon Jan 07 23:38:01 CST 2008
The same as negative value, Alexander!
regards,
George
"Alexander Nickolov" wrote:
> I suspect Bo misunderstood you by thinking of user input.
> Note there's no invalid value for the size in operator new.
> Thus if you specify an unreasonably large value the allocator
> will honestly attempt to allocate that large chunk of memory
> and fail - because there's not enough memory.
>
> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD
> email: agnickolov@mvps.org
> MVP VC FAQ:
http://vcfaq.mvps.org
> =====================================
>
> "George" <George@discussions.microsoft.com> wrote in message
> news:67565296-364C-4647-AD4C-22B5BBE85643@microsoft.com...
> > So Bo,
> >
> >
> > In your experience, invalid input value does not cause bad_alloc? So, the
> > only case you met with is out of memory?
> >
> >
> > regards,
> > George
> >
> > "Bo Persson" wrote:
> >
> >> George wrote:
> >> :: Hello everyone,
> >> ::
> >> ::
> >> :: I am wondering except when there is no memory on heap, are there
> >> :: any other situations when we will get bad_alloc exceptions? For
> >> :: example, invalid input of the size (e.g. very huge number or zero
> >> :: or negative number) will cause exception?
> >> ::
> >>
> >> A bad_alloc tells you that a memory allocation failed.
> >>
> >> Processing input *might* involve some internal memory allocation, so
> >> it could cause a bad_alloc. Generally it does not.
> >>
> >>
> >>
> >> Bo Persson
> >>
> >>
> >>
>
>
>