Re: A89: Re: Re: Custom Variables
[Prev][Next][Index][Thread]
Re: A89: Re: Re: Custom Variables
Hi!
> On Mon, Jul 17, 2000 at 18:16:58 +0200, Zeljko Juric wrote:
> >
> > if(!(h=HeapAlloc(HeapMax()))) return H_NULL;
> > if(!(sym_entry=DerefSym(SymAdd(sptr)))) return H_NULL;
>
> Assume the user has 1000 bytes available. Then HeapAlloc(HeapMax())
> works and allocates everything. Now SymAdd() fails because there's
> no room to add the new entry in the folder and your function
> returns. Where did those 1000 bytes go???
You are right. In the hell :-) Thank's for pointing me...
By the way, does anybody want to check correctness of my
implementations of non-TIOS routines in tigcclib (like fopen etc.)
in according to sources included in "sources" file in tigcclib?
> > *(long*)HLock(sym_entry->handle=h)=0x00010000;
>
> Why lock?
Again you are right. If I use handles, the exact location of
the file is not important.
> Also, keep in mind that size==HeapSize(HeapAlloc(size)) is not always
true!
> (Not that you seem to rely on it, I'm just pointing out the fact...)
>
> Actually it's HeapSize(HeapAlloc(size))==(size<6 ? 6 : (size+1)&-2)
Third time, you are right :-)))
Zeljko Juric