Commit 03974a96 authored by Kenton Varda's avatar Kenton Varda

Correct 'segment' to 'section' in places that clearly meant 'section'.

parent eba66ff5
......@@ -42,7 +42,7 @@ TEST(WireFormat, SimpleRawDataStruct) {
AlignedData<2> data = {{
// Struct ref, offset = 1, dataSize = 1, pointerCount = 0
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
// Content for the data segment.
// Content for the data section.
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef
}};
......@@ -286,8 +286,8 @@ TEST(WireFormat, StructRoundTrip_OneSegment) {
// 13 struct list
// 1 tag
// 12 4x struct
// 1 data segment
// 1 pointer segment
// 1 data section
// 1 pointer section
// 1 sub-struct
// 11 list list
// 5 pointers to sub-lists
......
......@@ -1562,7 +1562,7 @@ struct WireHelpers {
case FieldSize::POINTER:
// We expected a list of pointers but got a list of structs. Assuming the first field
// in the struct is the pointer we were looking for, we want to munge the pointer to
// point at the first element's pointer segment.
// point at the first element's pointer section.
ptr += tag->structRef.dataSize.get();
KJ_REQUIRE(tag->structRef.ptrCount.get() > 0 * POINTERS,
"Expected a pointer list, but got a list of data-only structs.") {
......@@ -2162,7 +2162,7 @@ StructReader ListReader::getStructElement(ElementCount index) const {
// This check should pass if there are no bugs in the list pointer validation code.
KJ_DASSERT(structPointerCount == 0 * POINTERS ||
(uintptr_t)structPointers % sizeof(WirePointer) == 0,
"Pointer segment of struct list element not aligned.");
"Pointer section of struct list element not aligned.");
return StructReader(
segment, structData, structPointers,
......@@ -2172,7 +2172,7 @@ StructReader ListReader::getStructElement(ElementCount index) const {
static const WirePointer* checkAlignment(const void* ptr) {
KJ_DASSERT((uintptr_t)ptr % sizeof(WirePointer) == 0,
"Pointer segment of struct list element not aligned.");
"Pointer section of struct list element not aligned.");
return reinterpret_cast<const WirePointer*>(ptr);
}
......
......@@ -66,7 +66,7 @@ enum class FieldSize: uint8_t {
FOUR_BYTES = 4,
EIGHT_BYTES = 5,
POINTER = 6, // Indicates that the field lives in the pointer segment, not the data segment.
POINTER = 6, // Indicates that the field lives in the pointer section, not the data section.
INLINE_COMPOSITE = 7
// A composite type of fixed width. This serves two purposes:
......@@ -324,14 +324,14 @@ public:
// with non-zero default values.
StructBuilder initStructField(WirePointerCount ptrIndex, StructSize size);
// Initializes the struct field at the given index in the pointer segment. If it is already
// Initializes the struct field at the given index in the pointer section. If it is already
// initialized, the previous value is discarded or overwritten. The struct is initialized to
// the type's default state (all-zero). Use getStructField() if you want the struct to be
// initialized as a copy of the field's default value (which may have non-null pointers).
StructBuilder getStructField(WirePointerCount ptrIndex, StructSize size,
const word* defaultValue);
// Gets the struct field at the given index in the pointer segment. If the field is not already
// Gets the struct field at the given index in the pointer section. If the field is not already
// initialized, it is initialized as a deep copy of the given default value (a flat message),
// or to the empty state if defaultValue is nullptr.
......@@ -392,10 +392,10 @@ private:
WirePointer* pointers; // Pointer to the encoded pointers.
BitCount32 dataSize;
// Size of data segment. We use a bit count rather than a word count to more easily handle the
// Size of data section. We use a bit count rather than a word count to more easily handle the
// case of struct lists encoded with less than a word per element.
WirePointerCount16 pointerCount; // Size of the pointer segment.
WirePointerCount16 pointerCount; // Size of the pointer section.
BitCount8 bit0Offset;
// A special hack: If dataSize == 1 bit, then bit0Offset is the offset of that bit within the
......@@ -428,7 +428,7 @@ public:
KJ_ALWAYS_INLINE(T getDataField(ElementCount offset) const);
// Get the data field value of the given type at the given offset. The offset is measured in
// multiples of the field size, determined by the type. Returns zero if the offset is past the
// end of the struct's data segment.
// end of the struct's data section.
template <typename T>
KJ_ALWAYS_INLINE(
......@@ -437,14 +437,14 @@ public:
// fields with non-zero default values.
StructReader getStructField(WirePointerCount ptrIndex, const word* defaultValue) const;
// Get the struct field at the given index in the pointer segment, or the default value if not
// Get the struct field at the given index in the pointer section, or the default value if not
// initialized. defaultValue will be interpreted as a flat message -- it must point at a
// struct pointer, which in turn points at the struct value. The default value is allowed to
// be null, in which case an empty struct is used.
ListReader getListField(WirePointerCount ptrIndex, FieldSize expectedElementSize,
const word* defaultValue) const;
// Get the list field at the given index in the pointer segment, or the default value if not
// Get the list field at the given index in the pointer section, or the default value if not
// initialized. The default value is allowed to be null, in which case an empty list is used.
template <typename T>
......@@ -476,10 +476,10 @@ private:
const WirePointer* pointers;
BitCount32 dataSize;
// Size of data segment. We use a bit count rather than a word count to more easily handle the
// Size of data section. We use a bit count rather than a word count to more easily handle the
// case of struct lists encoded with less than a word per element.
WirePointerCount16 pointerCount; // Size of the pointer segment.
WirePointerCount16 pointerCount; // Size of the pointer section.
BitCount8 bit0Offset;
// A special hack: If dataSize == 1 bit, then bit0Offset is the offset of that bit within the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment