source: project/release/5/coops-utils/trunk/object-uword-ref.scm @ 38400

Last change on this file since 38400 was 38400, checked in by Kon Lovett, 6 months ago

style, use memory module

File size: 615 bytes
Line 
1;;;; object-uword-ref.scm
2;;;; Kon Lovett, Mar '20
3
4;; Issues
5;;
6
7(cond-expand
8  (64bit
9    (begin
10      (define-constant C_UWORD_SIZE 8)
11      (define-syntax pointer-uword-ref
12        (syntax-rules ()
13          ((pointer-uword-ref ?ptr)
14            (pointer-u64-ref ?ptr) ) ) ) ) )
15  (else
16    (define-constant C_UWORD_SIZE 4)
17    (define-syntax pointer-uword-ref
18      (syntax-rules ()
19        ((pointer-uword-ref ?ptr ?idx)
20          (pointer-u32-ref ?ptr) ) ) ) ) )
21
22(define-inline (object-uword-ref proc #!optional (idx 0))
23  (pointer-uword-ref (pointer+ (object->pointer proc) (* C_UWORD_SIZE (add1 idx)))) )
Note: See TracBrowser for help on using the repository browser.