diff --git a/lolevel.scm b/lolevel.scm
index 86ae299..f847917 100644
|
a
|
b
|
|
| 40 | 40 | # include <sys/mman.h> |
| 41 | 41 | #endif |
| 42 | 42 | |
| 43 | | #define C_w2b(x) C_fix(C_wordstobytes(C_unfix(x))) |
| 44 | 43 | #define C_memmove_o(to, from, n, toff, foff) C_memmove((char *)(to) + (toff), (char *)(from) + (foff), (n)) |
| 45 | 44 | EOF |
| 46 | 45 | ) ) |
| … |
… |
EOF |
| 424 | 423 | [(##core#inline "C_byteblockp" x) |
| 425 | 424 | (##sys#size x)] |
| 426 | 425 | [else |
| 427 | | (##core#inline "C_w2b" (##sys#size x))] ) ) |
| | 426 | (##core#inline "C_bytes" (##sys#size x))] ) ) |
| 428 | 427 | |
| 429 | 428 | |
| 430 | 429 | ;;; Record objects: |
diff --git a/tests/lolevel-tests.scm b/tests/lolevel-tests.scm
index 886a07a..d0398fa 100644
|
a
|
b
|
|
| 12 | 12 | (let ((s "...")) |
| 13 | 13 | (assert-error (move-memory! "abc" s 3 -1))) |
| 14 | 14 | |
| | 15 | ; overlapping src and dest, moving "right" (from SRFI-13 tests) |
| | 16 | (assert (string=? |
| | 17 | "aabce" |
| | 18 | (let ((str (string-copy "abcde"))) |
| | 19 | (move-memory! str str 3 0 1) str))) |
| | 20 | ;; Specialisation rewrite from types.db |
| | 21 | (assert (string=? |
| | 22 | "aabce" |
| | 23 | (let ((str (string-copy "abcde"))) |
| | 24 | (move-memory! (make-locative str) (make-locative str) 3 0 1) str))) |
| | 25 | |
| | 26 | ; overlapping src and dest, moving "left" (from SRFI-13 tests) |
| | 27 | (assert (string=? |
| | 28 | "bcdde" |
| | 29 | (let ((str (string-copy "abcde"))) |
| | 30 | (move-memory! str str 3 1) str))) |
| | 31 | ;; Specialisation rewrite from types.db |
| | 32 | (assert (string=? |
| | 33 | "bcdde" |
| | 34 | (let ((str (string-copy "abcde"))) |
| | 35 | (move-memory! (make-locative str) (make-locative str) 3 1) str))) |
| | 36 | |
| 15 | 37 | ; object-copy |
| 16 | 38 | |
| 17 | 39 | ; allocate |
diff --git a/tests/runtests.sh b/tests/runtests.sh
index 5007f8a..4acb2e3 100755
|
a
|
b
|
echo "*** Skipping \"feeley-dynwind\" for now ***" |
| 165 | 165 | |
| 166 | 166 | echo "======================================== lolevel tests ..." |
| 167 | 167 | $interpret -s lolevel-tests.scm |
| 168 | | $compile lolevel-tests.scm |
| | 168 | $compile -O3 lolevel-tests.scm |
| 169 | 169 | ./a.out |
| 170 | 170 | |
| 171 | 171 | echo "======================================== arithmetic tests ..." |
diff --git a/types.db b/types.db
index a66f044..d5fc4fb 100644
|
a
|
b
|
|
| 1501 | 1501 | (((or port procedure symbol pair vector locative float pointer-vector)) |
| 1502 | 1502 | ;; would be applicable to all structure types, but we can't specify |
| 1503 | 1503 | ;; "(struct *)" (yet) |
| 1504 | | (##core#inline "C_w2b" (##sys#size #(1))))) |
| | 1504 | (##core#inline "C_bytes" (##sys#size #(1))))) |
| 1505 | 1505 | |
| 1506 | 1506 | (number-of-slots (#(procedure #:clean) number-of-slots (*) fixnum) |
| 1507 | 1507 | (((or vector symbol pair)) (##sys#size #(1)))) |