diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-08 22:44:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-08 22:44:44 (GMT) |
commit | 8c663fd60ecba9c82aa4c404dbfb1aae69fe8553 (patch) | |
tree | 8aed07de4d990bd998a61a051f3ac6b1a88f6392 /Modules | |
parent | 0e163d2ced28ade8ff526e8c663faf03c2c0b168 (diff) | |
download | cpython-8c663fd60ecba9c82aa4c404dbfb1aae69fe8553.zip cpython-8c663fd60ecba9c82aa4c404dbfb1aae69fe8553.tar.gz cpython-8c663fd60ecba9c82aa4c404dbfb1aae69fe8553.tar.bz2 |
Replace KB unit with KiB (#4293)
kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte")
means 1024 bytes. KB was misused: replace kB or KB with KiB when
appropriate.
Same change for MB and GB which become MiB and GiB.
Change the output of Tools/iobench/iobench.py.
Round also the size of the documentation from 5.5 MB to 5 MiB.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_hashopenssl.c | 2 | ||||
-rw-r--r-- | Modules/_io/fileio.c | 2 | ||||
-rw-r--r-- | Modules/_io/winconsoleio.c | 2 | ||||
-rw-r--r-- | Modules/_threadmodule.c | 4 | ||||
-rw-r--r-- | Modules/faulthandler.c | 4 | ||||
-rw-r--r-- | Modules/hashtable.c | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 01f1671..d597987 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -801,7 +801,7 @@ _hashlib_scrypt_impl(PyObject *module, Py_buffer *password, Py_buffer *salt, } if (maxmem < 0 || maxmem > INT_MAX) { - /* OpenSSL 1.1.0 restricts maxmem to 32MB. It may change in the + /* OpenSSL 1.1.0 restricts maxmem to 32 MiB. It may change in the future. The maxmem constant is private to OpenSSL. */ PyErr_Format(PyExc_ValueError, "maxmem must be positive and smaller than %d", diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index cc7061f..b6755b8 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -41,7 +41,7 @@ #if BUFSIZ < (8*1024) #define SMALLCHUNK (8*1024) #elif (BUFSIZ >= (2 << 25)) -#error "unreasonable BUFSIZ > 64MB defined" +#error "unreasonable BUFSIZ > 64 MiB defined" #else #define SMALLCHUNK BUFSIZ #endif diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index 6600fde..30d1c76 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -31,7 +31,7 @@ #if BUFSIZ < (16*1024) #define SMALLCHUNK (2*1024) #elif (BUFSIZ >= (2 << 25)) -#error "unreasonable BUFSIZ > 64MB defined" +#error "unreasonable BUFSIZ > 64 MiB defined" #else #define SMALLCHUNK BUFSIZ #endif diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 99611ee..aaa13da 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -1276,10 +1276,10 @@ exception is raised, and the stack size is unmodified. 32k bytes\n\ sufficient stack space for the interpreter itself.\n\ \n\ Note that some platforms may have particular restrictions on values for\n\ -the stack size, such as requiring a minimum stack size larger than 32kB or\n\ +the stack size, such as requiring a minimum stack size larger than 32 KiB or\n\ requiring allocation in multiples of the system memory page size\n\ - platform documentation should be referred to for more information\n\ -(4kB pages are common; using multiples of 4096 for the stack size is\n\ +(4 KiB pages are common; using multiples of 4096 for the stack size is\n\ the suggested approach in the absence of more specific information)."); static PyMethodDef thread_methods[] = { diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 9b51f7e..33edc05 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -14,8 +14,8 @@ # include <sys/resource.h> #endif -/* Allocate at maximum 100 MB of the stack to raise the stack overflow */ -#define STACK_OVERFLOW_MAX_SIZE (100*1024*1024) +/* Allocate at maximum 100 MiB of the stack to raise the stack overflow */ +#define STACK_OVERFLOW_MAX_SIZE (100 * 1024 * 1024) #define FAULTHANDLER_LATER diff --git a/Modules/hashtable.c b/Modules/hashtable.c index 0547a6d..e6f8daf 100644 --- a/Modules/hashtable.c +++ b/Modules/hashtable.c @@ -243,7 +243,7 @@ _Py_hashtable_print_stats(_Py_hashtable_t *ht) ht, ht->entries, ht->num_buckets, load * 100.0); if (nchains) printf("avg_chain_len=%.1f, ", (double)total_chain_len / nchains); - printf("max_chain_len=%" PY_FORMAT_SIZE_T "u, %" PY_FORMAT_SIZE_T "u kB\n", + printf("max_chain_len=%" PY_FORMAT_SIZE_T "u, %" PY_FORMAT_SIZE_T "u KiB\n", max_chain_len, size / 1024); } #endif |