From b42afa4b2182216c54d2c000b874649692b22040 Mon Sep 17 00:00:00 2001 From: Xie Yanbo Date: Fri, 21 Jun 2024 16:33:18 +0800 Subject: [PATCH] Fix typos in comments --- Objects/codeobject.c | 2 +- Objects/complexobject.c | 2 +- Objects/dictobject.c | 2 +- Objects/listobject.c | 4 ++-- Objects/mimalloc/bitmap.c | 4 ++-- Objects/mimalloc/heap.c | 2 +- Objects/obmalloc.c | 2 +- Objects/unicodeobject.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 95da63506c670a..cf8d26dd786043 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -236,7 +236,7 @@ intern_constants(PyObject *tuple, int *modified) Py_DECREF(tmp); } - // Intern non-string consants in the free-threaded build, but only if + // Intern non-string constants in the free-threaded build, but only if // we are also immortalizing objects that use deferred reference // counting. PyThreadState *tstate = PyThreadState_GET(); diff --git a/Objects/complexobject.c b/Objects/complexobject.c index a8be266970afd0..7b62fe30b2b007 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -912,7 +912,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) * handles the case of no arguments and one positional argument, and calls * complex_new(), implemented with Argument Clinic, to handle the remaining * cases: 'real' and 'imag' arguments. This separation is well suited - * for different constructor roles: convering a string or number to a complex + * for different constructor roles: converting a string or number to a complex * number and constructing a complex number from real and imaginary parts. */ static PyObject * diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 51cfdf1c4d8c55..5529e527d8bea3 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -5383,7 +5383,7 @@ dictiter_iternextitem_lock_held(PyDictObject *d, PyObject *self, #ifdef Py_GIL_DISABLED // Grabs the key and/or value from the provided locations and if successful -// returns them with an increased reference count. If either one is unsucessful +// returns them with an increased reference count. If either one is unsuccessful // nothing is incref'd and returns -1. static int acquire_key_value(PyObject **key_loc, PyObject *value, PyObject **value_loc, diff --git a/Objects/listobject.c b/Objects/listobject.c index dc9df3c3614fb4..9eae9626f7c1f1 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1866,7 +1866,7 @@ count_run(MergeState *ms, sortslice *slo, Py_ssize_t nremaining) /* In general, as things go on we've established that the slice starts with a monotone run of n elements, starting at lo. */ - /* We're n elements into the slice, and the most recent neq+1 elments are + /* We're n elements into the slice, and the most recent neq+1 elements are * all equal. This reverses them in-place, and resets neq for reuse. */ #define REVERSE_LAST_NEQ \ @@ -1918,7 +1918,7 @@ count_run(MergeState *ms, sortslice *slo, Py_ssize_t nremaining) Py_ssize_t neq = 0; for ( ; n < nremaining; ++n) { IF_NEXT_SMALLER { - /* This ends the most recent run of equal elments, but still in + /* This ends the most recent run of equal elements, but still in * the "descending" direction. */ REVERSE_LAST_NEQ diff --git a/Objects/mimalloc/bitmap.c b/Objects/mimalloc/bitmap.c index ec3c755822dac1..31830756f58c7c 100644 --- a/Objects/mimalloc/bitmap.c +++ b/Objects/mimalloc/bitmap.c @@ -7,7 +7,7 @@ terms of the MIT license. A copy of the license can be found in the file /* ---------------------------------------------------------------------------- Concurrent bitmap that can set/reset sequences of bits atomically, -represeted as an array of fields where each field is a machine word (`size_t`) +represented as an array of fields where each field is a machine word (`size_t`) There are two api's; the standard one cannot have sequences that cross between the bitmap fields (and a sequence must be <= MI_BITMAP_FIELD_BITS). @@ -108,7 +108,7 @@ bool _mi_bitmap_try_find_from_claim(mi_bitmap_t bitmap, const size_t bitmap_fiel return false; } -// Like _mi_bitmap_try_find_from_claim but with an extra predicate that must be fullfilled +// Like _mi_bitmap_try_find_from_claim but with an extra predicate that must be fulfilled bool _mi_bitmap_try_find_from_claim_pred(mi_bitmap_t bitmap, const size_t bitmap_fields, const size_t start_field_idx, const size_t count, mi_bitmap_pred_fun_t pred_fun, void* pred_arg, diff --git a/Objects/mimalloc/heap.c b/Objects/mimalloc/heap.c index 26777f39fb6aa5..d92dc768e5ec28 100644 --- a/Objects/mimalloc/heap.c +++ b/Objects/mimalloc/heap.c @@ -446,7 +446,7 @@ void mi_heap_delete(mi_heap_t* heap) if (heap==NULL || !mi_heap_is_initialized(heap)) return; if (!mi_heap_is_backing(heap)) { - // tranfer still used pages to the backing heap + // transfer still used pages to the backing heap mi_heap_absorb(heap->tld->heap_backing, heap); } else { diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index 4fe195b63166c1..d033e2bad1891a 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -1346,7 +1346,7 @@ static int running_on_valgrind = -1; typedef struct _obmalloc_state OMState; /* obmalloc state for main interpreter and shared by all interpreters without - * their own obmalloc state. By not explicitly initalizing this structure, it + * their own obmalloc state. By not explicitly initializing this structure, it * will be allocated in the BSS which is a small performance win. The radix * tree arrays are fairly large but are sparsely used. */ static struct _obmalloc_state obmalloc_state_main; diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 279cdaa668e291..1e74fef024677d 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -6245,7 +6245,7 @@ _PyUnicode_GetNameCAPI(void) ucnhash_capi = (_PyUnicode_Name_CAPI *)PyCapsule_Import( PyUnicodeData_CAPSULE_NAME, 1); - // It's fine if we overwite the value here. It's always the same value. + // It's fine if we overwrite the value here. It's always the same value. _Py_atomic_store_ptr(&interp->unicode.ucnhash_capi, ucnhash_capi); } return ucnhash_capi;