Catching memory allocation exceptions
- From: "Jona Vark" <noemail@xxxxxxx>
- Date: Sat, 30 Jul 2005 00:59:59 GMT
I haven't used C++ exception handling a lot in the past and I am about to
begin using it for an app I am working on.
I have to allocate large arrays of data for a 3 channel waveform made up of
about 40 megasamples of 16 bit (short) data each.
I am not really sure how much of that I can stream off disk at once. I would
like to learn how much memory 'would' be available to me and then create the
arrays with the amount of available memory.
Q1 ---> I am using the 'new' / 'delete[]' method but I don;t understand how
I might predetermine how much memory I can have. Would I loop with
tryu/new/catch until I have a successful allocation?
Once I figure out the proper combination of try/catch/throw to use (any
examples welcome) ..
Q2 ---> How do I actually 'cause' an exception like that to test it?
thanks
eng
.
- Follow-Ups:
- Re: Catching memory allocation exceptions
- From: Charlie Brown
- but how would you test a memory allocation exception handler?
- From: Jona Vark
- Re: Catching memory allocation exceptions
- From: Jona Vark
- Re: Catching memory allocation exceptions
- From: Scot T Brennecke
- Re: Catching memory allocation exceptions
- From: Mark Randall
- Re: Catching memory allocation exceptions
- Prev by Date: Re: using same precompiled header file for all projects in a workspace?
- Next by Date: Re: Catching memory allocation exceptions
- Previous by thread: Re: using same precompiled header file for all projects in a workspace?
- Next by thread: Re: Catching memory allocation exceptions
- Index(es):
Relevant Pages
|