07.02.2015 13:27, Alex Peshkoff wrote:
>
> I do not see too big trouble with full checks of string args. But what
> about keeping legacy dup check present in ERR_post()? Taking into an
> account that string once made permanent will remain the same per thread
> suppose it will be enough for most cases.

What if the same exception will be made permanent twice, at different 
places? String pointers will be different, but their contents the same.

And even the easy check costs us a performance penalty as 
stuff_exception() is often called 3-5 times during the stack unwinding. 
This wasn't the case with ERR_post().

That said, stack unwinding is not a performance critical part, so maybe 
we can live with that. But see below.

> Completely removing tdbb_status_vector will break warnings delivery.

OK, I can live with tdbb_status_vector used exclusively for the warnings.

> I think that merging errors in stuffException() is both simpler and more
> efficient.

Merging errors into tdbb_status_vector is not enough. It leads 
tdbb_status_vector to keep {A, B}, but only either A or B will be 
thrown. This is not how ERR_*() routines work, as they always throw the 
whole tdbb_status_vector. Also, JRD's transliterateException() 
completely ignores tdbb_status_vector and returns only the catched 
exception. Ideally, stuff_exception() should also reset the exception 
object with the merged vector to ensure that the active exception is in 
sync with tdbb_status_vector. It's doable if ex is status_exception but 
e.g. BadAlloc has no status vector inside.

Finally, it opens gates for undesired items to unexpectedly appear 
inside the status vector (current behavior or stuff_exception() hides 
that). This is not bad per se, as it allows us to find and fix such 
cases. But I'd rather avoid such side effects at the Beta stage.


Dmitry


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to