Changeset 5068


Ignore:
Timestamp:
Sep 2, 2006, 10:01:19 AM (18 years ago)
Author:
Gary Byers
Message:

Try to avoid things like %COPY-IVECTOR-TO-IVECTOR when strings are
involved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/db-io.lisp

    r4972 r5068  
    312312  (let* ((string (format nil "~s ~s ~d " "OpenMCL Interface File" (backend-name *target-backend*) *interface-abi-version*)))
    313313    (%stack-block ((buf 512))
    314       (%copy-ivector-to-ptr string 0 buf 0 (length string))
     314      (%cstr-pointer string buf)
    315315      (fid-write (cdbm-fid cdbm) buf 512))))
    316316
     
    393393        (fid-read fid buf 512)
    394394        (let* ((string (make-string 512)))
    395           (%copy-ptr-to-ivector buf 0 string 0 512)
     395          (dotimes (i 512)
     396            (setf (schar string i) (%get-unsigned-byte buf i)))
    396397          (with-input-from-string (s string)
    397398            (let* ((sig (ignore-errors (read s)))
     
    567568               (encoding (make-string encoding-len)))
    568569          (declare (dynamic-extent encoding))
    569           (%copy-ptr-to-ivector dptr (+ 2 name-len) encoding 0 encoding-len)
     570          (%str-from-ptr (%inc-ptr dptr (+ 2 name-len)) encoding-len encoding)
    570571          (cdb-free (pref datum :cdb-datum.data))
    571572          (multiple-value-bind (args result)
     
    635636  (let* ((dsize (+ 4 (length val))))
    636637    (%stack-block ((valbuf dsize))
    637       (%copy-ivector-to-ptr val 0 valbuf 4 (length val))
     638      (dotimes (i (length val))
     639        (setf (%get-unsigned-byte valbuf (the fixnum (+ 4 i)))
     640              (%scharcode val i)))
    638641      (setf (%get-long valbuf) class)
    639642      (rletZ ((content :cdb-datum)
     
    14351438    (if (zerop n)
    14361439      (values nil (1+ p))
    1437       (let* ((pname (make-string n)))
    1438         (%copy-ptr-to-ivector buf (1+ p) pname 0 n)
     1440      (let* ((pname (%str-from-ptr (%inc-ptr buf (1+ p)) n)))
    14391441        (values (if verbatim pname (escape-foreign-name pname))
    14401442                (+ p (1+ n)))))))
Note: See TracChangeset for help on using the changeset viewer.