Xref: utzoo comp.lang.fortran:3235 comp.sys.ibm.pc.programmer:1762 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!nntp-server.caltech.edu!tybalt.caltech.edu!walton From: walton@tybalt.caltech.edu (Steve Walton) Newsgroups: comp.lang.fortran,comp.sys.ibm.pc.programmer Subject: Dynamic memory allocation under MS Fortran? Summary: Is it possible? If so, how? Message-ID: <1990Jun2.205903.22240@laguna.ccsf.caltech.edu> Date: 2 Jun 90 20:59:03 GMT Sender: news@laguna.ccsf.caltech.edu Organization: California Institute of Technology, Pasadena Lines: 18 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