main
Matthew Butterick 6 years ago
parent 0bffe1b26c
commit adadae2154

@ -61,9 +61,9 @@ https://github.com/mbutterick/restructure/blob/master/src/Array.coffee
(send @type x:encode item port parent))))
(cond
[(x:int? @len)
(define new-parent (mhash x:pointers-key null
x:start-offset-key (pos port)
x:parent-key parent))
(define new-parent (mhasheq x:pointers-key null
x:start-offset-key (pos port)
x:parent-key parent))
(hash-set! new-parent x:pointer-offset-key (+ (pos port) (x:size array new-parent)))
(send @len x:encode (length array) port) ; encode length at front
(encode-items new-parent)

@ -86,9 +86,9 @@ https://github.com/mbutterick/restructure/blob/master/src/VersionedStruct.coffee
(define/override (x:size [val #f] [parent-arg #f] [include-pointers #t])
(unless val
(raise-argument-error 'x:versioned-struct-size "value" val))
(define parent (mhash x:parent-key parent-arg
x:val-key val
x:pointer-size-key 0))
(define parent (mhasheq x:parent-key parent-arg
x:val-key val
x:pointer-size-key 0))
(define version-size
(let ([struct-type @type])
(if (or (symbol? struct-type) (procedure? struct-type))

Loading…
Cancel
Save