Security Basics mailing list archives

Re: question about malloc()


From: nmk14 () aub edu lb
Date: 15 Sep 2005 14:14:30 -0000

(1<<30) is twice as big as (1<<29) since 1 is shifted one more position to the left. So maybe malloc is not finding 
enough space to allocate 2exp30 (2 to the power 30) memory however it could allocate 2exp29. After all, it depends on 
how malloc is implemented, I presume that it tries to allocate contiguous memory and that why even though u mighthave 
way more than 2exp30 free, they are not contiguous.

I hope that i have helped

Best Regards
Naji Khalaf


Current thread: