Re: Dynamic Allocation Issues...
- From: Barry Schwarz <schwarzb@xxxxxxxxx>
- Date: Thu, 26 May 2005 21:31:47 -0700
On Thu, 26 May 2005 12:01:04 +0530, "Muthukumar"
<muthu@xxxxxxxxxxxxxx> wrote:
>Dear Pals,
>
>Query 1:
>
>In my Win32 console application using Microsoft C compiler, I am using
>malloc() to allocate memory for the Pointer variables. These allocations are
>working very fine, but sometimes malloc() failed to allocate memory and
>gives Unhandled Exception error. Pointer variable has no allocated memory
>and hence it leads to Unhandled Exception.
When malloc fails, it returns NULL. You are supposed to check before
you use the returned value to reference memory.
>
>Could you please tell me in which cases malloc get fails to allocate memory?
>How to resolve this issue as a permanent?
It fails whenever it fails. It could be for lack of memory. It could
be for fragmented memory. ...
>
>Query 2:
> During the deallocation time using the free() , I am getting the "Debug
>Assertion failed" error in some cases. What might be the reason for getting
>this Error? Could you please give the better solution.
What is the value of the argument when this occurs.
<<Remove the del for email>>
.
- References:
- Dynamic Allocation Issues...
- From: Muthukumar
- Dynamic Allocation Issues...
- Prev by Date: Re: Dynamic Allocation Issues...
- Next by Date: fatal error C1083: Cannot open compiler intermediate file: 'c:\Temp\a02852ex': Permission denied
- Previous by thread: Re: Dynamic Allocation Issues...
- Next by thread: fatal error C1083: Cannot open compiler intermediate file: 'c:\Temp\a02852ex': Permission denied
- Index(es):
Relevant Pages
|