• 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
1,924
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?
 

Chuck(G)

25k Member
Joined
Jan 11, 2007
Messages
40,753
Location
Pacific Northwest, USA
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).
 

Eudimorphodon

Veteran Member
Joined
May 9, 2011
Messages
5,433
Location
Upper Triassic
... 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.
 
Top