[comp.unix.xenix] far_malloc for SCO Xenix

ked@garnet.berkeley.edu (Earl H. Kinmonth) (02/09/89)

Does anyone have working equivalents to far_malloc() and far_free() for
SCO Xenix 286?

I tried taking the memory manager given in K & R and patching it to use
brkctl(). So far I have not made it work. The problem appears to be in
the comparison of unnormalized far pointers.

In lieu of working code for a far_malloc(), I would appreciate
suggestions on how to convert the K & R memory manager (or some other
readily available "malloc") to handle far pointers.

Is there any good reason why there is not such a routine in the C
library for SCO Xenix? MSC and Turbo C both provide these so it is
apparently possible.

E H. Kinmonth, Hist. Dept.,  Univ. of Ca., Davis Davis, Ca. 95616
916-752-1636/0776

Disclaimer:  This is AmeriKa!  Who needs a disclaimer!

Internet:  ehkinmonth@ucdavis.edu
           cck@deneb.ucdavis.edu
BITNET:    ehkinmonth@ucdavis
UUCP:      {ucbvax, lll-crg}!ucdavis!ehkinmonth
           {ucbvax, lll-crg}!ucdavis!deneb!cck

frankb@usource.UUCP (Frank Bicknell) (02/10/89)

In article <20114@agate.BERKELEY.EDU>, ked@garnet.berkeley.edu (Earl H. Kinmonth) writes:

> Does anyone have working equivalents to far_malloc() and
> far_free() for SCO Xenix 286? 

Check out the library routines in Llibc.a called fmalloc()
and ffree().  These routines are found in fmalloc.o.  There
are also routines called nmalloc() and nfree() in nmalloc.o.
 
I stumbled upon these while trying to cheat the malloc() call
and install my own which kept track of pointers (see Dr Dobbs,
June, 1988...).

The routines aren't documented anywhere that I know of, but
their behaviour seems to be predictable... they are the far and
near versions of malloc() and free().
-- 
Frank Bicknell                                       \      Pi are round, silly!
USMAIL: 1405 Main St, Ste 709, Sarasota, FL 34236   ==------------------------\ 
UUCP: killer!usource!frankb                         ==------------------------/ 
DOMAIN: frankb@usource.UUCP                          /