mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-14 21:32:49 -08:00
With the new inline behavior we can make ASSERT-TYPE-IF-KNOWN more efficient by use of ecl_unlikely().
This commit is contained in:
parent
b8ce2506ed
commit
4d1d068edf
1 changed files with 8 additions and 0 deletions
|
|
@ -124,8 +124,16 @@ safety settings and when the type is not trivial."
|
|||
(if (or ok (not valid))
|
||||
value
|
||||
(with-clean-symbols (%value)
|
||||
#+(or)
|
||||
`(let ((%value ,value))
|
||||
(unless (typep %value ',type)
|
||||
(ffi:c-inline (',type %value) (:object :object) :void
|
||||
"FEwrong_type_argument(#0,#1);" :one-liner nil))
|
||||
(the ,type %value))
|
||||
`(let ((%value ,value))
|
||||
(declare (:read-only %value))
|
||||
(ffi:c-inline ((typep %value ',type) ',type %value)
|
||||
(:bool :object :object) :void
|
||||
"if (ecl_unlikely(!(#0)))
|
||||
FEwrong_type_argument(#1,#2);" :one-liner nil)
|
||||
(the ,type %value))))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue