home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
o
/
os2xlisp.zip
/
HUGE.LSP
< prev
next >
Wrap
Text File
|
1992-06-26
|
1KB
|
30 lines
; huge.lsp
; allocate huge memory in OS/2
; for OS2XLISP v. 1.5
; Andrew Schulman 27-June-1988
(define DOSALLOCHUGE (getprocaddr doscalls "DOSALLOCHUGE"))
(define DOSGETHUGESHIFT (getprocaddr doscalls "DOSGETHUGESHIFT"))
(define DOSFREESEG (getprocaddr doscalls "DOSFREESEG"))
(define (alloc-huge segs
&optional (rem 0) (opt 0) ; optional parameters
&aux (seg 0) (shift 0) (lst nil)) ; local variables
(if (not (zerop
(call DOSALLOCHUGE (word segs) (word rem) ^seg (word 0) (word opt))))
nil
; else
(progn
(call DOSGETHUGESHIFT ^shift)
(setf shift (shl 1 shift))
(setf lst (list (new-node seg))) ; (new-node) needed!!
(dotimes
(i (if (zerop rem) (1- segs) segs))
(nconc lst (list (+ seg (* (1+ i) shift)))))
lst)))
(define (free-huge seg)
(zerop (call DOSFREESEG (word (if (listp seg) (car seg) seg)))))