about summary refs log tree commit diff stats
path: root/061read-byte.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-04-03 12:35:53 -0700
committerKartik Agaram <vc@akkartik.com>2020-04-03 12:35:53 -0700
commitbfcc0f858aa324739ad645e2056d73a47ab66f82 (patch)
tree24a22e364b2c1d535013c604b7a9620a31606e71 /061read-byte.subx
parentf730f2f2c7934f52091a848b71f9031ea99e2377 (diff)
downloadmu-bfcc0f858aa324739ad645e2056d73a47ab66f82.tar.gz
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.
Diffstat (limited to '061read-byte.subx')
-rw-r--r--061read-byte.subx10
1 files changed, 5 insertions, 5 deletions
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