• Please review our updated Terms and Rules here

Why were some C libraries model specific and others not

alank2

Veteran Member
Joined
Aug 3, 2016
Messages
2,256
Location
USA
Looking at an old Turbo C distribution, there are some libraries like emu.lib, fp87.lib, or graphics.lib which did not have 6 versions of themselves for each memory model. Why didn't these require a model specific version?
 
Sometimes the size of code or data didn't matter. One can always far call (at least in an .exe) code even from a small model. Similarly, unless pointers to far data are being passed, it may not matter if the invocation is call-by-value (default for C).
 
... Was about to post something along the lines of what Chuck said. I'd assume the "universal" libraries are mostly functions that can be "inlined" because they're called by value or can be sic'ed on buffer structures that are set up outside the functions within the library themselves; they don't have any code that would need to fool segment registers or pointers directly.
 
Back
Top