[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More (tiny) PFile fixes

Bjarke Hammersholt Roune wrote:

>This reminds me. You said you'd fix the memory leak in one of the Stat()
>functions. The windows version has the exact same leak, as it behaves
>pretty much the same, so if ou fix it for the unix version, it would
>probably be a good idea to do the same thing for the windows version.

Yup, good that you remind me of that. I hope I can fix that tonight.

>We might want to consider simply giving the client code the
>responsibility for freeing the resource. That, or a function for freeing
>the stat as a whole (?).

No, the client shouldn't have to worry. Internal functions calling ppfStat
() can free the memory if neccessary (via some internal cleanup function)
and for externals I'll use some static ring of char[].
That means it's only guaranteed that the name parts returned by ppfStat()
to external callers are only valid for the past 16 (or 32) calls. That's
perfectly fine (usually stat() only guarantees validity for *one* call).


Drive A: not responding...Formatting C: instead