home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!gatech!hubcap!jtbell
- From: jtbell@hubcap.clemson.edu (Jon Bell)
- Subject: Re: Block Data is evil
- Message-ID: <1993Jan23.151052.6593@hubcap.clemson.edu>
- Organization: Presbyterian College, Clinton SC
- References: <1993Jan21.074755.14939@arcetri.astro.it> <1993Jan22.183106.15813@newshost.lanl.gov> <C1AMpC.BAt@umassd.edu>
- Date: Sat, 23 Jan 1993 15:10:52 GMT
- Lines: 25
-
- In article <C1AMpC.BAt@umassd.edu> hshubs@cis.umassd.edu (Howard S Shubs) writes:
- >In <1993Jan22.183106.15813@newshost.lanl.gov> jlg@cochiti.lanl.gov (J. Giles) writes:
- >
- >>Yes, and that permits you to do run-time management of a statically
- >>allocated "maximum" space. You figure out what the maximum memory
- >>you ever need is and you statically allocate that much:
- >
- >> PARAMETER (MAXMEM=1000000)
- >> COMMON /MEMORY/ MEM(MAXMEM)
- >
- >>This reserves one million integer sized words. Now, you can write
- >>a MALLOC routine which returns avalable space from within this array
- >>in the form of an index (you actually have two mallocs, one for
- >>integers and reals, the other for complex and doubles - since the
- >>indices must be scaled differently). To use:
- >
- >You're not seriously suggesting that this be used in production code,
- >are you? If you are, is this intended as job security?
-
- It's already been done. When I was a grad student in experimental
- particle physics, I worked with CERN's HYDRA library, which implemented
- dynamic memory allocation in FORTRAN using the same basic idea. I
- think this package is still widely used in particle physics.
-
- Jon Bell / Dept. of Physics & C.S. / Presbyterian College / Clinton SC USA
-