Commit 6bfea2b3 authored by Sean McBride's avatar Sean McBride
Browse files

Disambiguated use of term “kilobyte”

After being confused by headerdoc use of the word
“kilobyte”, I did a bit of an audit:

- changed many comments to use kibibyte and also
added the number 1024
- noted that one function returns bytes, unlike many
other functions with same name that return kibibytes
- changed some default value initializations
that were a mix of power 2 and power 10 ex:
vtkPImageWriter called “1 gigabyte” = 1000000 kibibytes,
changed to power 2 since that’s prevailing in VTK

Although many don’t like the binary prefixes,
they have the advantage of being unambiguous.
parent c5f47eac
......@@ -270,7 +270,7 @@ public:
virtual void ExportToVoidPointer(void *vtkNotUsed(out_ptr)) {}
// Description:
// Return the memory in kilobytes consumed by this data array. Used to
// Return the memory in kibibytes (1024 bytes) consumed by this data array. Used to
// support streaming and reading/writing data. The value returned is
// guaranteed to be greater than or equal to the memory required to
// actually represent the data represented by this object. The
......
......@@ -885,7 +885,7 @@ unsigned long vtkDataArray::GetActualMemorySize()
size = vtkDataArray::GetDataTypeSize(this->GetDataType());
// kilobytes
// kibibytes
return static_cast<unsigned long>(ceil((size*static_cast<double>(numPrims)
)/1024.0));
}
......
......@@ -275,7 +275,7 @@ public:
virtual void* WriteVoidPointer(vtkIdType id, vtkIdType number) = 0;
// Description:
// Return the memory in kilobytes consumed by this data array. Used to
// Return the memory in kibibytes (1024 bytes) consumed by this data array. Used to
// support streaming and reading/writing data. The value returned is
// guaranteed to be greater than or equal to the memory required to
// actually represent the data represented by this object. The
......
......@@ -97,7 +97,7 @@ public:
virtual void ShallowCopy(vtkPoints *ad);
// Description:
// Return the memory in kilobytes consumed by this attribute data.
// Return the memory in kibibytes (1024 bytes) consumed by this attribute data.
// Used to support streaming and reading/writing data. The value
// returned is guaranteed to be greater than or equal to the
// memory required to actually represent the data represented
......
......@@ -97,7 +97,7 @@ public:
virtual void ShallowCopy(vtkPoints2D *ad);
// Description:
// Return the memory in kilobytes consumed by this attribute data.
// Return the memory in kibibytes (1024 bytes) consumed by this attribute data.
// Used to support streaming and reading/writing data. The value
// returned is guaranteed to be greater than or equal to the
// memory required to actually represent the data represented
......
......@@ -496,7 +496,7 @@ unsigned long vtkStringArray::GetActualMemorySize( void )
}
return static_cast<unsigned long>(
ceil(static_cast<double>(totalSize) / 1024.0 )); // kilobytes
ceil(static_cast<double>(totalSize) / 1024.0 )); // kibibytes
}
// ----------------------------------------------------------------------------
......
......@@ -231,7 +231,7 @@ public:
//ETX
// Description:
// Return the memory in kilobytes consumed by this data array. Used to
// Return the memory in kibibytes (1024 bytes) consumed by this data array. Used to
// support streaming and reading/writing data. The value returned is
// guaranteed to be greater than or equal to the memory required to
// actually represent the data represented by this object. The
......
......@@ -64,7 +64,7 @@ public:
virtual void Squeeze();
virtual int Resize(vtkIdType numTuples);
virtual void SetVoidArray(void *array, vtkIdType size, int save);
virtual unsigned long GetActualMemorySize();
virtual unsigned long GetActualMemorySize(); // in bytes
virtual int IsNumeric();
virtual vtkArrayIterator* NewIterator();
virtual vtkVariant GetVariantValue(vtkIdType idx);
......
......@@ -597,7 +597,7 @@ unsigned long vtkVariantArray::GetActualMemorySize()
totalSize = numPrims*sizeof(vtkVariant);
return static_cast<unsigned long>(
ceil(static_cast<double>(totalSize) / 1024.0)); // kilobytes
ceil(static_cast<double>(totalSize) / 1024.0)); // kibibytes
}
//----------------------------------------------------------------------------
......
......@@ -175,7 +175,7 @@ public:
int save);
// Description:
// Return the memory in kilobytes consumed by this data array. Used to
// Return the memory in kibibytes (1024 bytes) consumed by this data array. Used to
// support streaming and reading/writing data. The value returned is
// guaranteed to be greater than or equal to the memory required to
// actually represent the data represented by this object. The
......
......@@ -220,7 +220,7 @@ public:
{this->Ia->Squeeze();}
// Description:
// Return the memory in kilobytes consumed by this cell array. Used to
// Return the memory in kibibytes (1024 bytes) consumed by this cell array. Used to
// support streaming and reading/writing data. The value returned is
// guaranteed to be greater than or equal to the memory required to
// actually represent the data represented by this object. The
......
......@@ -267,7 +267,7 @@ unsigned long vtkCellLinks::GetActualMemorySize()
size *= sizeof(int *); //references to cells
size += (this->MaxId+1) * sizeof(vtkCellLinks::Link); //list of cell lists
return static_cast<unsigned long>( ceil(size/1024.0)); //kilobytes
return static_cast<unsigned long>( ceil(size/1024.0)); // kibibytes
}
//----------------------------------------------------------------------------
......
......@@ -112,7 +112,7 @@ public:
void Reset();
// Description:
// Return the memory in kilobytes consumed by this cell links array.
// Return the memory in kibibytes (1024 bytes) consumed by this cell links array.
// Used to support streaming and reading/writing data. The value
// returned is guaranteed to be greater than or equal to the memory
// required to actually represent the data represented by this object.
......
......@@ -277,7 +277,7 @@ unsigned long vtkCellTypes::GetActualMemorySize()
size += this->LocationArray->GetActualMemorySize();
}
return static_cast<unsigned long>(ceil(size/1024.0)); //kilobytes
return static_cast<unsigned long>(ceil(size/1024.0)); // kibibytes
}
......
......@@ -96,7 +96,7 @@ public:
void Reset();
// Description:
// Return the memory in kilobytes consumed by this cell type array.
// Return the memory in kibibytes (1024 bytes) consumed by this cell type array.
// Used to support streaming and reading/writing data. The value
// returned is guaranteed to be greater than or equal to the memory
// required to actually represent the data represented by this object.
......
......@@ -76,7 +76,7 @@ public:
// Description:
// Return the actual size of the data in kilobytes. This number
// Return the actual size of the data in kibibytes (1024 bytes). This number
// is valid only after the pipeline has updated.
virtual unsigned long GetActualMemorySize();
......
......@@ -113,7 +113,7 @@ public:
unsigned long GetUpdateTime();
// Description:
// Return the actual size of the data in kilobytes. This number
// Return the actual size of the data in kibibytes (1024 bytes). This number
// is valid only after the pipeline has updated. The memory size
// returned is guaranteed to be greater than or equal to the
// memory required to represent the data (e.g., extra space in
......
......@@ -99,7 +99,7 @@ public:
virtual int HasMetaData(vtkCompositeDataIterator* iter);
// Description:
// Return the actual size of the data in kilobytes. This number
// Return the actual size of the data in kibibytes (1024 bytes). This number
// is valid only after the pipeline has updated.
virtual unsigned long GetActualMemorySize();
......
......@@ -295,7 +295,7 @@ public:
virtual int GetMaxCellSize() = 0;
// Description:
// Return the actual size of the data in kilobytes. This number
// Return the actual size of the data in kibibytes (1024 bytes). This number
// is valid only after the pipeline has updated. The memory size
// returned is guaranteed to be greater than or equal to the
// memory required to represent the data (e.g., extra space in
......
......@@ -223,7 +223,7 @@ public:
void Reset();
// Description:
// Return the memory in kilobytes consumed by this field data. Used to
// Return the memory in kibibytes (1024 bytes) consumed by this field data. Used to
// support streaming and reading/writing data. The value returned is
// guaranteed to be greater than or equal to the memory required to
// actually represent the data represented by this object.
......
Supports Markdown
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