[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Always return?
- Date: Thu, 18 Sep 2003 06:10:13 -0500
- From: joel.sherrill at OARcorp.com (Joel Sherrill)
- Subject: Always return?
Ian Caddy wrote:
>Hi,
>
>In this function size is an unsigned32 so effectively the comparison is
>to compare whether size is getting close to the limit of an unsigned32.
>
>The negative number is converted to an unsigned32 which causes it to be
>a very large positive number for the comparison.
>
>
Correct. And it might also make sense to further limit the size of the
maximum request. Anything greater than sizeof RAM minus the code space
is always unsatisfiable.
--joel
>Hope this helps,
>
>Ian Caddy
>
>
>shannon wrote:
>
>
>
>> if ( size >= (-1 - HEAP_BLOCK_USED_OVERHEAD) )
>> return( NULL );
>>
>>This is a sentence in heapallocate.c. I think size is more than 0, and (-1-HEAP_BLOCK_USED_OVERHEAD) equals -9. Then the routine will be returned. Is what I think right? However, should the routine exit here?
>>
>>
>>????? ???shannon
>>??????????2003-09-18
>>
>>
>>
>>
>>
>
>
>