impc:ti:zone-alloc-check   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmti.xtm

Implementation

;; make should be of the form
;; (alloc type)
;; where type is a valid type
;; (alloc i64)
;; memory is allocated on the head
(define impc:ti:zone-alloc-check
  (lambda (ast vars kts request?)
    (if (and request?
             (not (impc:ir:pointer? request?))
             (not (symbol? request?)))
        (impc:compiler:print-compiler-error "Allocation must return pointer type" ast))
    (if (= (length ast) 2)
        (let ((a (impc:ti:type-check (cadr ast) vars kts (list *impc:ir:si64* *impc:ir:si32*))))
          request?)
        request?)))


Back to Index