/
cxx.lisp
1 (in-package :cl-smoke.benchmark)
2
3 (define-foreign-library libcl-smoke-benchmark
4 (t (:default "libcl-smoke-benchmark")))
5
6 (let ((*foreign-library-directories*
7 (cons (asdf:component-pathname (asdf:find-system :cl-smoke.benchmark))
8 *foreign-library-directories*)))
9 (use-foreign-library libcl-smoke-benchmark))
10
11 (defctype size-t :unsigned-int)
12
13 (declaim (inline cl-smoke-benchmark-byte-array-size))
14 (defcfun cl-smoke-benchmark-byte-array-size :void
15 (iterations size-t))
16
17 (declaim (inline cl-smoke-benchmark-overload))
18 (defcfun cl-smoke-benchmark-overload :unsigned-int
19 (iterations size-t))
20
21 (declaim (inline cl-smoke-benchmark-signal-slot))
22 (defcfun cl-smoke-benchmark-signal-slot :void
23 (iterations size-t))
24
25 (defcfun cl-smoke-benchmark-construct-setup :void
26 (iterations size-t))
27
28 (declaim (inline cl-smoke-benchmark-construct))
29 (defcfun cl-smoke-benchmark-construct :char
30 (iterations size-t))
31
32 (defcfun cl-smoke-benchmark-construct-cleanup :void
33 (iterations size-t))
34
35
36 (defmacro with-benchmark-cxx-construct ((iterations) &body body)
37 `(progn
38 (cl-smoke-benchmark-construct-setup ,iterations)
39 ,@body
40 (cl-smoke-benchmark-construct-cleanup ,iterations)))
41
42
43 (defcfun cl-smoke-benchmark-simple-call :void
44 (iterations size-t))