On Mon, 07 Dec 2009, Pritpal Bedi wrote:

Hi

> > It may change in different HVM version so no one should create code
> > which depends on current behavior anyhow if you are interested what
> > happens now then return value is overwritten by last return value in
> > executed code (depending on context it may cause some serious runtime
> > problems (Pritpal should remember problems with runtime errors due to
> > overloaded returned logical value in xHarbour) and the exception (QUIT,
> > BREAK, ENDPROC) is not properly restored. Additionally stack items
> > allocated for stored data are not freed until returning to upper level
> > HB_FUNC which activated such C code so executing hb_vmRequestReenter()
> > without hb_vmRequestRestore() in a loop increase the stack size. We
> > have automatic stack resizing so it will not generate any visible
> > error until system has enough memory but of course resources are
> > consumed.
> May be this gives a clue towards memory consumption 
> which was keeping growing. Actually hb_vmRequestReenter()
> was being called unmatched with hb_vmRequestRestore() in 
> all the slots handelling code.

Without deep code analyzing I cannot precisely answer but after
short looking at hbqt_slots.cpp I do not think so. Missing
hb_vmRequestRestore() can increase HVM stack a little bit but
only to some fixed value which is rather small in comparison
to total memory usage so I do not think so.

> Should we use these calls or not ?

You should. The above text was only about side effects created by
wrong usage of hb_vmRequestReenter() without hb_vmRequestRestore()
and I hope that know will create any code which depends on that
side effects because they may change in the future. I.e. we can
add code to generate RT or internal error if hb_vmRequestReenter()
does not have corresponding hb_vmRequestRestore().

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to