RE: [AD] mode-list updates. |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
> >realloc has some cool features. for example if ptr is NULL it works
> >equivalent to malloc and if size is 0 it works equivalent to free.
> >
> AFAIK this is not true for every compiler out there.
>
> it is for gcc, and I think it is for msvc, but I'm not sure if it's
> in the ansi c specs.
This behavior is ANSI standard, but some libc implementations that
claim to be ANSI compliant fail to implement this correctly. IIRC,
some versions of SunOS are faulty for this. The biggest problem with
this IMHO is that relatively few people know how it works, and are
therefore likely to treat this as a bug.
Lua, for instance, does all its memory management through realloc,
but has a special version of it for non ANSI compliant implementations.
--
Vincent Penquerc'h
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |