At 08:12 PM 12/12/2001 -0500, [EMAIL PROTECTED] wrote:
>Dan wrote:
> >># In lieu of a de-allocator for mem_allocate_aligned I vote
> >># we at least do something in the interim and I volunteer to
> >># help as soon as someone decides what it is!
> >>
> >>Maybe we can have a mem_free_aligned that somehow figures out what the
> >>starting address is. If we do that and document which data structures
> >>are aligned and which aren't, we shouldn't have a problem.
> >
> >You can't do that--there's no way to tell where the memory block really
> >started.
>
>Right, at least while everyone is allocating memory by multiple
>methods. Too bad free() is too dumb() :), some mem management
>libs I recall use some magic cookie values to validate, hidden
>in a negative offset of the chunk, but apparently we can't
>rely on that.

Oh, we could if we returned the address we were handed. We don't, which is 
the issue. Assuming there's a magic cookie value we can search back on's 
dangerous--it works 99.8% of the time, and debugging that last .2% when the 
program's crashing randomly's about as much fun as hitting yourself in the 
head with a brick.

> >
> >Anyway, all the aligned stuff's a bit of a hack-up to make up for the lack
> >of arenas. It'll be fixed right reasonably soon.
>
>Cheer!

:) Nothing like actually doing it right...

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to