Mail Archives: djgpp-workers/2002/03/06/02:33:34
Eli Zaretskii wrote:
>
> On Tue, 5 Mar 2002, CBFalconer wrote:
>
> > If you have a list we could have _sysmalloc take a record
> > parameter, consisting of an array of functional pointers, or
> > possibly an index/pointer pair to set/reset a specific hook.
>
> I can send you the CVS version of malloc, which calls hooks in several
> places (if you still don't have access to the CVS). Would that help?
>
> > Again, there is no problem doing these things, once the needs are
> > known. A line has to be drawn somewhere.
>
> Of course; I didn't want to imply that you need to do all of this. I was
> just discussing related issues, that's all. Feel free to drop this if
> you think it's way off what you intend to do.
Probably would be helpful (the CVS version). My idea would be to
scan it to abstract the hook mechanism, so that it could be
designed with future flexibility in mind. That is what I tried to
do with the _sysmalloc() idea.
One inherent danger that has occured to me - using the sysmalloc
to track the existing allocations would often involve software
that used malloc to form their database, thus altering the data.
I was thinking of something that would automatically point out
memory leaks and the ilk. A walk could create a list of all
existing allocations. The results would have to be stored in an
automatic or otherwise pre-allocated structure, whose size is not
known apriori (except possibly by a pre-walk). Enter C99 variable
arrays!
--
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
Available for consulting/temporary embedded and systems.
(Remove "XXXX" from reply address. yahoo works unmodified)
mailto:uce AT ftc DOT gov (for spambots to harvest)
- Raw text -