Re: [AD] Memory handling problems in 4.3.10 |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Wed, 2008-09-24 at 20:54 +1000, Peter Wang wrote:
> On 2008-09-24, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> > Seems not even our own ustrdup uses _AL_MALLOC - that also needs to be
> > fixed.
>
> Hmm. If ustrdup() uses _AL_MALLOC(), then it should be paired with
> _AL_FREE(). _AL_FREE() is supposed to be internal, so how does a caller
> of ustrdup() know which free function to call?
>
> I think this means we need to add al_malloc(), al_free(), etc.
>
True. Either that, or stop using ustrdup in internal code (and keep
telling the user to free it with free). Or we make a special ufree()
with the only purpose to clean up after ustrdup. But looking towards A5,
I think al_malloc, al_free, al_strdup is the best way to go.
--
Elias Pschernig <elias@xxxxxxxxxx>