aboutsummaryrefslogtreecommitdiff
path: root/sys/nmemio/malloc.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /sys/nmemio/malloc.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/nmemio/malloc.x')
-rw-r--r--sys/nmemio/malloc.x24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/nmemio/malloc.x b/sys/nmemio/malloc.x
new file mode 100644
index 00000000..d5886c36
--- /dev/null
+++ b/sys/nmemio/malloc.x
@@ -0,0 +1,24 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <syserr.h>
+include <config.h>
+
+# MALLOC -- Allocate space on the heap. An array of at least NELEMS elements
+# of data type DTYPE is allocated, aligned to SZ_MEMALIGN (the biggest type)
+# with the global common Mem.
+
+procedure malloc (ubufp, nelems, dtype)
+
+pointer ubufp # user buffer pointer (output)
+int nelems # number of elements of storage required
+int dtype # datatype of the storage elements
+
+int sz_align, fwa_align
+int malloc1()
+
+begin
+ sz_align = SZ_MEMALIGN
+ call zlocva (Memc, fwa_align)
+ if (malloc1 (ubufp, nelems, dtype, sz_align, fwa_align) == ERR)
+ call syserr (SYS_MFULL)
+end