[comp.lang.fortran] Dynamic memory allocation under MS Fortran?

walton@tybalt.caltech.edu (Steve Walton) (06/03/90)

I have been trying to build a Fortran dynamic memory allocator
for MS Fortran 4.1 using the trick mentioned here previously:
passing a COMMON block array of length 1 to an allocation
routine (in C), and returning the array "index" needed to 
get to the start of the allocated RAM from the COMMON.  In the
process, I discovered that even under HUGE model, MS Fortran
uses 16-bit arithmetic to find the address of an element of an
array in COMMON.  The code is something like:

	common /alloc/ array(1)
	call falloc(array, is)
	call sub(array(is))

Disassembly shows 16-bit arithmetic used to get the address of
array(is).  Any solutions out there?  Is this fixed in 5.0?
--
Stephen Walton, srw@csun.edu, Cal State Northridge
posting from Caltech until my feed is fixed

walton@tybalt.caltech.edu (Steve Walton) (06/04/90)

I'm told by e-mail (Dave Tholen, tholen@ifa.hawaii.edu) that MS Fortran
5.0 has the Fortran-90 ALLOCATE and DEALLOCATE statements.  I also found
by experiment that my previous code works provided the reference
array is dimensioned at least 64K+1.
--
Stephen Walton, srw@csun.edu, Cal State Northridge
posting from Caltech until my feed is fixed