Changeset 39732 in project


Ignore:
Timestamp:
03/17/21 00:44:07 (5 weeks ago)
Author:
Kon Lovett
Message:

canon naming

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/mailbox/trunk/inline-queue.scm

    r39730 r39732  
    164164  (fxmod (fx+ i (fx- (vector-length (%queue-limited-vector q)) 1)) (%queue-limited-limit q)) )
    165165
     166(define-inline (%queue-limited-start-inc! q)
     167  (%queue-limited-start-set! q (%queue-limited-index-inc q (%queue-limited-start q))) )
     168
     169(define-inline (%queue-limited-start-dec! q)
     170  (%queue-limited-start-set! q (%queue-limited-index-dec q (%queue-limited-start q))) )
     171
     172(define-inline (%queue-limited-end-inc! q)
     173  (%queue-limited-end-set! q (%queue-limited-index-inc q (%queue-limited-end q))) )
     174
     175(define-inline (%queue-limited-end-dec! q)
     176  (%queue-limited-end-set! q (%queue-limited-index-dec q (%queue-limited-end q))) )
     177
    166178(define-inline (%queue-limited-limit-set! q v)
    167179  (error '%queue-limited-limit-set! "immutable" v) )
     
    184196(define-inline (%queue-limited-add! q v)
    185197  (%queue-limited-poke! q (%queue-limited-end q) v)
    186   (%queue-limited-end-set! q (%queue-limited-index-inc q (%queue-limited-end q))) )
     198  (%queue-limited-end-inc! q) )
    187199
    188200(define-inline (%queue-limited-remove! q)
    189201  (let ((v (%queue-limited-peek q (%queue-limited-start q))))
    190     (%queue-limited-start-set! q (%queue-limited-index-inc q (%queue-limited-start q)))
     202    (%queue-limited-start-inc! q)
    191203    v ) )
    192204
    193205(define-inline (%queue-limited-push-back! q v)
    194   (%queue-limited-start-set! q (%queue-limited-index-dec q (%queue-limited-start q)))
     206  (%queue-limited-start-dec! q)
    195207  (%queue-limited-poke! q (%queue-limited-start q) v) )
    196208
     
    208220(define-inline (%make-queue-limited-cursor) (cons -1 (void)))
    209221(define-inline (%queue-limited-cursor? c) (pair? c))
    210 (define-inline (%queue-limited-index c) (car c))
    211 (define-inline (%queue-limited-index-set! c v) (set-car! c v))
     222(define-inline (%queue-limited-cursor-index c) (car c))
     223(define-inline (%queue-limited-cursor-index-set! c v) (set-car! c v))
    212224
    213225(define-inline (%queue-limited-cursor-winding? q c)
    214   (fx<= 0 (%queue-limited-index c)) )
     226  (fx<= 0 (%queue-limited-cursor-index c)) )
    215227
    216228(define-inline (%queue-limited-cursor-unwound? q c)
    217   (fx= (%queue-limited-end q) (%queue-limited-index c)) )
     229  (fx= (%queue-limited-end q) (%queue-limited-cursor-index c)) )
    218230
    219231(define-inline (%queue-limited-cursor-start! q c)
    220   (%queue-limited-index-set! c (%queue-limited-start q)) )
     232  (%queue-limited-cursor-index-set! c (%queue-limited-start q)) )
    221233
    222234;#!eof | *
    223235(define-inline (%queue-limited-cursor-next! q c)
    224236  (cond
    225     ((%queue-limited-cursor-unwound? q c)  #!eof)
     237    ((%queue-limited-cursor-unwound? q c) #!eof)
    226238    (else
    227       (let ((v (%queue-limited-peek q (%queue-limited-index c))))
    228         (%queue-limited-index-set! c (%queue-limited-index-inc q (%queue-limited-index c)))
     239      (let ((v (%queue-limited-peek q (%queue-limited-cursor-index c))))
     240        (%queue-limited-cursor-index-set! c
     241          (%queue-limited-index-inc q (%queue-limited-cursor-index c)))
    229242        v ) ) ) )
    230243
    231244(define-inline (%queue-limited-cursor-continue! q c)
    232245  #; ;assert index is end - 1
    233   (%queue-limited-index-set! c (%queue-limited-index-dec q (%queue-limited-end q)))
     246  (%queue-limited-cursor-index-set! c
     247    (%queue-limited-index-dec q (%queue-limited-end q)))
    234248  (void) )
    235249
    236250(define-inline (%queue-limited-cursor-rewind! q c)
    237   (%queue-limited-index-set! c -1) )
     251  (%queue-limited-cursor-index-set! c -1) )
    238252
    239253(define-inline (%queue-limited-cursor-extract! q c)
     
    241255  (when (%queue-limited-cursor-winding? q c)
    242256    ;move "up" from i-1 to i until i = start
    243     (let loop ((i (%queue-limited-index-dec q (%queue-limited-index c))))
     257    (let loop ((i (%queue-limited-index-dec q (%queue-limited-cursor-index c))))
    244258      (let ((i-1 (%queue-limited-index-dec q i)))
    245259        (%queue-limited-poke! q i (%queue-limited-peek q i-1))
     
    294308(define-inline (%make-queue-unbuffered-cursor) (cons -1 (void)))
    295309(define-inline (%queue-unbuffered-cursor? c) (pair? c))
    296 (define-inline (%queue-unbuffered-index c) (car c))
    297 (define-inline (%queue-unbuffered-index-set! c v) (set-car! c v))
     310(define-inline (%queue-unbuffered-cursor-index c) (car c))
     311(define-inline (%queue-unbuffered-cursor-index-set! c v) (set-car! c v))
    298312
    299313(define-inline (%queue-unbuffered-cursor-winding? q c)
    300   (fx<= 0 (%queue-unbuffered-index c)) )
     314  (fx<= 0 (%queue-unbuffered-cursor-index c)) )
    301315
    302316(define-inline (%queue-unbuffered-cursor-unwound? q c)
    303   (fx= 1 (%queue-unbuffered-index c)) )
     317  (fx= 1 (%queue-unbuffered-cursor-index c)) )
    304318
    305319(define-inline (%queue-unbuffered-cursor-start! q c)
    306   (%queue-unbuffered-index-set! c 0) )
     320  (%queue-unbuffered-cursor-index-set! c 0) )
    307321
    308322;#!eof | *
     
    312326    ((not (%queue-unbuffered-maybe? q))       #!eof)
    313327    (else
    314       (%queue-unbuffered-index-set! c 1)
     328      (%queue-unbuffered-cursor-index-set! c 1)
    315329      (%queue-unbuffered-value q) ) ) )
    316330
    317331(define-inline (%queue-unbuffered-cursor-continue! q c)
    318   (%queue-unbuffered-index-set! c 0) )
     332  (%queue-unbuffered-cursor-index-set! c 0) )
    319333
    320334(define-inline (%queue-unbuffered-cursor-rewind! q c)
    321   (%queue-unbuffered-index-set! c -1) )
     335  (%queue-unbuffered-cursor-index-set! c -1) )
    322336
    323337(define-inline (%queue-unbuffered-cursor-extract! q c)
Note: See TracChangeset for help on using the changeset viewer.