[ros-dev] [ros-diffs] [greatlrd] 22195: make malloc, calloc and some other function return NULL if size is 0

James Tabor jimtabor at adsl-64-217-116-74.dsl.hstntx.swbell.net
Sat Jun 3 19:10:28 CEST 2006


Gunnar Dalsnes wrote:
> Magnus Olsen wrote:
> 
>>HI
>>Malloc(0) did not reaturn NULL;
>>that was the fix for. I am reading the IEEE spec
>>how malloc should work, and it exists two diffent
>>implement of it. and some exprenet on diffent windows
>>platfrom show diffent behvior about malloc(0)
>>
>>
> 
> 
> IEEE specs really have nothing to do with how Windows behaves. Windows 
> NEVER follow standards. A quick test on Win XP shows malloc(0) return a 
> pointer to stack, so MSDN is right (surprise!) and your fix is wrong. If 
> some older version of Windows did otherwise, this is a job for a 
> compability framework (which we dont have).
> 
Wow!
what a cheesy way to get the stack pointer.
James


More information about the Ros-dev mailing list