cs: fix allocation mode for _string/utf-16

Closes #3153
This commit is contained in:
Matthew Flatt 2020-05-04 07:18:05 -06:00
parent 6feb9c1095
commit cf4691ee87
2 changed files with 7 additions and 1 deletions

View File

@ -745,6 +745,9 @@
;; Check a corner of UTF-16 conversion:
(test "\U171D3" cast (cast "\U171D3" _string/utf-16 _gcpointer) _gcpointer _string/utf-16))
;; strings can be cast
(test "heλλo" cast (cast "he\u3bb\u3bbo" _string/utf-16 _gcpointer) _gcpointer _string/utf-16)
;; check async:
(when test-async?
(define (check async like)

View File

@ -674,7 +674,10 @@
(define (ctype-malloc-mode c)
(let ([t (ctype-our-rep c)])
(if (or (eq? t 'gcpointer) (eq? t 'scheme))
(if (or (eq? t 'gcpointer)
(eq? t 'scheme)
(eq? t 'string/ucs-4)
(eq? t 'string/utf-16))
'nonatomic
'atomic)))