- (once-only ((dst-start dst-start))
- `(flet ((sap (thing)
- (etypecase thing
- (system-area-pointer thing)
- ((simple-unboxed-array (*)) (vector-sap thing)))))
- (declare (inline sap))
- (without-gcing
- (memmove (sap+ (sap ,dst) ,dst-start)
- (sap+ (sap ,src) ,src-start)
- (- ,dst-end ,dst-start)))))
-
- ;; REMOVEME when new version works
- ;;
- ;; old version, had overflow problems because it converts byte
- ;; indices to bit indices, which is not good when GENESIS is trying
- ;; to read into a byte vector which represents the cold image (>16M bytes)
- #+nil
- `(let ((src ,src)
- (src-start (* ,src-start sb!vm:byte-bits))
- (dst ,dst)
- (dst-start (* ,dst-start sb!vm:byte-bits))
- (dst-end (* ,dst-end sb!vm:byte-bits)))
- (let ((length (- dst-end dst-start)))
- (etypecase src
- (system-area-pointer
- (etypecase dst
- (system-area-pointer
- (system-area-copy src src-start dst dst-start length))
- ((simple-unboxed-array (*))
- (copy-from-system-area src src-start
- dst (+ dst-start ,vector-data-bit-offset)
- length))))
- ((simple-unboxed-array (*))
- (etypecase dst
- (system-area-pointer
- (copy-to-system-area src (+ src-start ,vector-data-bit-offset)
- dst dst-start
- length))
- ((simple-unboxed-array (*))
- (bit-bash-copy src (+ src-start ,vector-data-bit-offset)
- dst (+ dst-start ,vector-data-bit-offset)
- length))))))))
+ '(flet ((sapify (thing)
+ (etypecase thing
+ (system-area-pointer thing)
+ ;; FIXME: The code here rather relies on the simple
+ ;; unboxed array here having byte-sized entries. That
+ ;; should be asserted explicitly, I just haven't found
+ ;; a concise way of doing it. (It would be nice to
+ ;; declare it in the DEFKNOWN too.)
+ ((simple-unboxed-array (*)) (vector-sap thing)))))
+ (declare (inline sapify))
+ (without-gcing
+ (memmove (sap+ (sapify dst) dst-start)
+ (sap+ (sapify src) src-start)
+ (- dst-end dst-start)))
+ nil))