mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
AK: Rename KB, MB, GB to KiB, MiB, GiB
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9". The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30". Let's use the correct name, at least in code. Only changes the name of the constants, no other behavior change.
This commit is contained in:
parent
a68650a7b4
commit
430b265cd4
31 changed files with 69 additions and 69 deletions
|
@ -44,7 +44,7 @@ public:
|
|||
bool has_error() const { return !m_error_string.is_null(); }
|
||||
const char* error_string() { return m_error_string.characters(); }
|
||||
|
||||
RefPtr<Buffer> get_more_samples(size_t max_bytes_to_read_from_input = 128 * KB);
|
||||
RefPtr<Buffer> get_more_samples(size_t max_bytes_to_read_from_input = 128 * KiB);
|
||||
|
||||
void reset();
|
||||
void seek(const int position);
|
||||
|
|
|
@ -73,7 +73,7 @@ static bool s_profiling = false;
|
|||
static unsigned short size_classes[] = { 8, 16, 32, 64, 128, 252, 508, 1016, 2036, 4090, 8188, 16376, 32756, 0 };
|
||||
static constexpr size_t num_size_classes = sizeof(size_classes) / sizeof(unsigned short);
|
||||
|
||||
constexpr size_t block_size = 64 * KB;
|
||||
constexpr size_t block_size = 64 * KiB;
|
||||
constexpr size_t block_mask = ~(block_size - 1);
|
||||
|
||||
struct CommonHeader {
|
||||
|
|
|
@ -109,7 +109,7 @@ void Job::on_socket_connected()
|
|||
ASSERT(m_state == State::InBody || m_state == State::Finished);
|
||||
|
||||
read_while_data_available([&] {
|
||||
auto read_size = 64 * KB;
|
||||
auto read_size = 64 * KiB;
|
||||
|
||||
auto payload = receive(read_size);
|
||||
if (!payload) {
|
||||
|
|
|
@ -1206,7 +1206,7 @@ JPGImageDecoderPlugin::JPGImageDecoderPlugin(const u8* data, size_t size)
|
|||
m_context = make<JPGLoadingContext>();
|
||||
m_context->data = data;
|
||||
m_context->data_size = size;
|
||||
m_context->huffman_stream.stream.ensure_capacity(50 * KB);
|
||||
m_context->huffman_stream.stream.ensure_capacity(50 * KiB);
|
||||
}
|
||||
|
||||
JPGImageDecoderPlugin::~JPGImageDecoderPlugin()
|
||||
|
|
|
@ -173,7 +173,7 @@ void Job::on_socket_connected()
|
|||
ASSERT(can_read());
|
||||
|
||||
read_while_data_available([&] {
|
||||
auto read_size = 64 * KB;
|
||||
auto read_size = 64 * KiB;
|
||||
if (m_current_chunk_remaining_size.has_value()) {
|
||||
read_chunk_size:;
|
||||
auto remaining = m_current_chunk_remaining_size.value();
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace JS {
|
|||
|
||||
class HeapBlock {
|
||||
public:
|
||||
static constexpr size_t block_size = 16 * KB;
|
||||
static constexpr size_t block_size = 16 * KiB;
|
||||
static NonnullOwnPtr<HeapBlock> create_with_cell_size(Heap&, size_t);
|
||||
|
||||
void operator delete(void*);
|
||||
|
|
|
@ -44,9 +44,9 @@ namespace {
|
|||
using PthreadAttrImpl = Syscall::SC_create_thread_params;
|
||||
} // end anonymous namespace
|
||||
|
||||
constexpr size_t required_stack_alignment = 4 * MB;
|
||||
constexpr size_t required_stack_alignment = 4 * MiB;
|
||||
constexpr size_t highest_reasonable_guard_size = 32 * PAGE_SIZE;
|
||||
constexpr size_t highest_reasonable_stack_size = 8 * MB; // That's the default in Ubuntu?
|
||||
constexpr size_t highest_reasonable_stack_size = 8 * MiB; // That's the default in Ubuntu?
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue