On Mon, 22 Mar 2004, Eric Auer wrote:

> Hi, about add_far() pointer normalization: I think it would be
> better to normalize earlier. If you have a pointer, you normally
> have a pointer to a STRUCTURE. If the end of the structure ends
> up with an offset > 0xffff then having the POINTER normalized is
> not enough. So how do you check the SIZE of the structure for
> which you normalize the pointer? Or do you just have an hardcoded
> constant "maximum structure size" for structures for which the
> add_far function can be used?

add_far is only used at a few select places where we want to have the
offset part as low as possible. Nothing to do with structures but
everything to do with potentially large file reads, with "read chunk,
update pointer" loops.

Quite possibly Arkady's approach minimizing normalizations has merit but
then each add_far caller needs to be checked if it needs to manually
normalize the pointer afterwards.

But for now, because it's not called very often, the time it takes is very
small in comparison with the BIOS calls following, and normalization doesn't
hurt, I haven't changed it.

Bart



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to