Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
e49874eb
Commit
e49874eb
authored
22 years ago
by
toy
Browse files
Options
Downloads
Patches
Plain Diff
Shorten the long lines to make TeX quieter.
parent
5e6c24e2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/cmu-user/aliens.tex
+22
-19
22 additions, 19 deletions
docs/cmu-user/aliens.tex
with
22 additions
and
19 deletions
docs/cmu-user/aliens.tex
+
22
−
19
View file @
e49874eb
...
@@ -631,10 +631,12 @@ function to initialize it, then returns a Lisp vector of all the
...
@@ -631,10 +631,12 @@ function to initialize it, then returns a Lisp vector of all the
(let* ((num (slot f 'a))
(let* ((num (slot f 'a))
(result (make-array num)))
(result (make-array num)))
;;
;;
;; Get a pointer to the array so that we don't have to keep extracting it:
;; Get a pointer to the array so that we don't have to keep
;; extracting it:
(with-alien ((a (* (array (* (struct foo)) 100)) (addr (slot f 'b))))
(with-alien ((a (* (array (* (struct foo)) 100)) (addr (slot f 'b))))
;;
;;
;; Loop over the first N elements and stash them in the result vector.
;; Loop over the first N elements and stash them in the
;; result vector.
(dotimes (i num)
(dotimes (i num)
(setf (svref result i) (deref (deref a) i)))
(setf (svref result i) (deref (deref a) i)))
result)))
result)))
...
@@ -809,22 +811,23 @@ must be an array of one of the following types:
...
@@ -809,22 +811,23 @@ must be an array of one of the following types:
;; ... ...
;; ... ...
;;
;;
(let ((addr (+ 8 (logandc1 7 (kernel:get-lisp-obj-address data))))
(let ((addr (+ 8 (logandc1 7 (kernel:get-lisp-obj-address data))))
(type-size (let ((type (array-element-type data)))
(type-size
(cond ((or (equal type '(signed-byte 8))
(let ((type (array-element-type data)))
(equal type '(unsigned-byte 8)))
(cond ((or (equal type '(signed-byte 8))
1)
(equal type '(unsigned-byte 8)))
((or (equal type '(signed-byte 16))
1)
(equal type '(unsigned-byte 16)))
((or (equal type '(signed-byte 16))
2)
(equal type '(unsigned-byte 16)))
((or (equal type '(signed-byte 32))
2)
(equal type '(unsigned-byte 32)))
((or (equal type '(signed-byte 32))
4)
(equal type '(unsigned-byte 32)))
((equal type 'single-float)
4)
4)
((equal type 'single-float)
((equal type 'double-float)
4)
8)
((equal type 'double-float)
(t
8)
(error "Unknown specialized array element type"))))))
(t
(error "Unknown specialized array element type"))))))
(declare (type (unsigned-byte 32) addr)
(declare (type (unsigned-byte 32) addr)
(optimize (speed 3) (safety 0) (ext:inhibit-warnings 3)))
(optimize (speed 3) (safety 0) (ext:inhibit-warnings 3)))
(system:int-sap (the (unsigned-byte 32)
(system:int-sap (the (unsigned-byte 32)
...
@@ -952,7 +955,7 @@ whose contents is:
...
@@ -952,7 +955,7 @@ whose contents is:
(setf (slot c-struct 's) "A Lisp String")
(setf (slot c-struct 's) "A Lisp String")
(with-alien ((res (* (struct c-struct))
(with-alien ((res (* (struct c-struct))
(c-function 5 "Another Lisp String" (addr c-struct) ar)))
(c-function 5 "Another Lisp String" (addr c-struct) ar)))
(format t "Returned from C function.~
%")
(format t "Returned from C function.~
%")
(multiple-value-prog1
(multiple-value-prog1
(values (slot res 'x)
(values (slot res 'x)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment