Passing in values to foreign-lambda* for UTF-8 validation instead of

using global variables.
This commit is contained in:
Thomas Hintz 2015-04-18 11:41:00 -07:00
parent 081209bd2f
commit fa6ec7695a
1 changed files with 2 additions and 4 deletions

View File

@ -291,10 +291,8 @@
; Try to validate as an ascii string first. Its essentially
; free, doesn't generate garbage and is many, many times
; faster than the general purpose validator.
(define-external ws_utlen int len)
(define-external ws_uts scheme-pointer s)
(= 1
((foreign-lambda* int ()
((foreign-lambda* int ((size_t ws_utlen) (scheme-pointer ws_uts))
"
if (ws_utlen > UINT_MAX) { return -1; }
@ -308,7 +306,7 @@
}
C_return(1);
"))))
") len s)))
(parse utf8-string (->parser-input s))))
(define (close-code->integer s)