Is there a way to use extended memory easily from C

Walter Bright bright at Data-IO.COM
Thu Mar 8 06:01:13 AEST 1990


In article <151 at vela.acs.oakland.edu> bbesler at vela.acs.oakland.edu (Brent Besler) writes:
<Is there
<any way to utilitze extended memory or EMS memory from Turbo C or Microsoft
<quick C?

In Zortech C/C++, there is a special pointer type called a handle pointer.
A pointer of this type is declared as:
	char __handle *h;
When allocating memory, instead of calling malloc, use:
	h = handle_malloc(size);
The syntax for using h is the same as for regular pointers, i.e. you can
do things like:
	*h = 'c';
	h[15] = 7;
	strcpy(h,p);
etc. The implementation of the handle pointers is such that they actually
allocate and refer to data in EMS. If no EMS is present in the execution
environment, then they behave like regular far pointers.

As far as I know, this facility is not available in any other DOS C compiler.

Standard disclaimer: I wrote it. I get paid for it. :-)



More information about the Comp.lang.c mailing list