declare the closure environment in c99
`max_align_t' is C11 and the union goes into every unit, so a program with no closure in it stopped building under -std=c99. `unify' also bound a rigid variable one way round only.
This commit is contained in:
14
semen.scm
14
semen.scm
@@ -693,13 +693,19 @@
|
||||
|
||||
(define +closure-env-bytes+ 16)
|
||||
|
||||
;;; +closure-env-bytes+ for maximum capacity, max-align-t for
|
||||
;;; effectiveness, hence union
|
||||
;;; +closure-env-bytes+ for maximum capacity, and an alignment wide
|
||||
;;; enough for anything that fits in them, hence union. `max_align_t'
|
||||
;;; would say that in one word, but it is C11 and the target is C99, so
|
||||
;;; the widest built-ins say it instead: a union is aligned for the
|
||||
;;; strictest of its members.
|
||||
(define +closure-env-type+ 'ƛenv)
|
||||
|
||||
(define (closure-env-declaration)
|
||||
`(union ,+closure-env-type+ ((align max-align-t)
|
||||
(bytes (¤ char ,+closure-env-bytes+)))))
|
||||
`(union ,+closure-env-type+ ((bytes (¤ char ,+closure-env-bytes+))
|
||||
(align-integer (long long))
|
||||
(align-real (long double))
|
||||
(align-pointer (* void))
|
||||
(align-code (fn ((* void)) void)))))
|
||||
|
||||
(define +closure-structs+ (make-hash-table))
|
||||
(define +closure-forwards+ (make-hash-table))
|
||||
|
||||
Reference in New Issue
Block a user