From bfcc0f858aa324739ad645e2056d73a47ab66f82 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 3 Apr 2020 12:35:53 -0700 Subject: 6182 - start of support for safe handles So far it's unclear how to do this in a series of small commits. Still nibbling around the edges. In this commit we standardize some terminology: The length of an array or stream is denominated in the high-level elements. The _size_ is denominated in bytes. The thing we encode into the type is always the size, not the length. There's still an open question of what to do about the Mu `length` operator. I'd like to modify it to provide the length. Currently it provides the size. If I can't fix that I'll rename it. --- 061read-byte.subx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '061read-byte.subx') diff --git a/061read-byte.subx b/061read-byte.subx index 178fe273..78b8a7b9 100644 --- a/061read-byte.subx +++ b/061read-byte.subx @@ -20,7 +20,7 @@ $Stdin->buffer: 0/imm32 # current read index 0/imm32 - # length + # size 8/imm32 # data 00 00 00 00 00 00 00 00 # 8 bytes @@ -246,7 +246,7 @@ test-read-byte-buffered-refills-buffer: # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # pretend buffer is full - # . _test-buffered-file->read = 6 # >= _test-buffered-file->length + # . _test-buffered-file->read = 6 # >= _test-buffered-file->size b8/copy-to-eax _test-buffered-file/imm32 c7 0/subop/copy 1/mod/*+disp8 0/rm32/eax . . . . 8/disp8 6/imm32 # copy to *(eax+8) # read-byte-buffered(_test-buffered-file) @@ -279,7 +279,7 @@ $_test-buffered-file->buffer: 0/imm32 # current read index 0/imm32 - # length + # size 6/imm32 # data 00 00 00 00 00 00 # 6 bytes @@ -289,7 +289,7 @@ _test-input-stream: # (stream byte) 0/imm32 # current read index 0/imm32 - # length + # size 0x100/imm32 # 256 bytes # data (16 lines x 16 bytes/line) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -318,7 +318,7 @@ $_test-input-buffered-file->buffer: 0/imm32 # current read index 0/imm32 - # length + # size 6/imm32 # data 00 00 00 00 00 00 # 6 bytes -- cgit 1.4.1-2-gfad0