From: calvin@dinkum.wpd.sgi.com (Calvin H. Vu)
Subject: Re: f77 compiler on DS3100 is missing falloc(), malloc(), free()
Date: 12 Oct 89 03:23:56 GMT [thread overview]
Message-ID: <42873@sgi.sgi.com> (raw)
In-Reply-To: 29313@gumby.mips.COM
> 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 <malloc.h>
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
prev parent reply other threads:[~1989-10-12 3:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1989-10-11 13:02 f77 compiler on DS3100 is missing falloc(), malloc(), free() Andy Thomas
1989-10-11 22:13 ` Lilian Leung
1989-10-12 3:23 ` Calvin H. Vu [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox