Always return?
Joel Sherrill
joel.sherrill at OARcorp.com
Thu Sep 18 11:10:13 UTC 2003
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
>>
>>
>>
>>
>>
>
>
>
More information about the users
mailing list