Xref: utzoo comp.sys.dec:1937 comp.sys.mips:211 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sgi!calvin@dinkum.wpd.sgi.com From: calvin@dinkum.wpd.sgi.com (Calvin H. Vu) Newsgroups: comp.sys.dec,comp.sys.mips Subject: Re: f77 compiler on DS3100 is missing falloc(), malloc(), free() Message-ID: <42873@sgi.sgi.com> Date: 12 Oct 89 03:23:56 GMT References: <3318@mace.cc.purdue.edu> <29313@gumby.mips.COM> Sender: calvin@dinkum.wpd.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 35 > In article <3318@mace.cc.purdue.edu>, ajt@mace.cc.purdue.edu (Andy Thomas) writes: > > > > included in a future release? Any suggestions on how make my own routines? > > > > Andy Thomas > > ajt@bilbo.bio.purdue.edu > > ajt@mace.cc.purdue.edu > Writing your own routine is easy. This is about the long and short of it (not tested, though): #include long malloc_( nbytes ) long *nbytes; { return((long)malloc(*nbytes)); } but using it is a little bit more tricky. Say, if you want to allocate a character string of 'numbytes': myspace = malloc(numbytes) call sub( %val(myspace), %val(numbytes) ) ........ subroutine sub( charstr ) character*(*) charstr C CHARSTR should be a string of numbytes long with the space C allocated for it by the malloc call return end ---------------- Calvin Vu Silicon Graphics calvin@wpd.sgi.com