Skip to content

Commit 5985a4a

Browse files
committed
Update comment
1 parent ae8dfea commit 5985a4a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Include/internal/pycore_code.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,14 @@ PyAPI_FUNC(PyObject*) _Py_GetSpecializationStats(void);
285285
#define EVAL_CALL_STAT_INC_IF_FUNCTION(name, callable) ((void)0)
286286
#endif // !Py_STATS
287287

288-
// NOTE: These cache reading/writing utilities use memcpy to avoid voilating C's
289-
// strict aliasing rules, while also avoiding the need to maintain big-endian
290-
// versions of the same code. Compilers are smart enough to understand what
291-
// we're really trying to do here (see https://blog.regehr.org/archives/959).
292-
293-
// When modifying these, great care must be taken to ensure that we don't break
294-
// or slow down our inline caching! All of these functions should compile to
295-
// simple "move" instructions on all supported compilers and platforms. You can
296-
// use the Compiler Explorer at https://godbolt.org to help verify this.
288+
// Utility functions for reading/writing 32/64-bit values in the inline caches.
289+
// Great care should be taken to ensure that these functions remain correct and
290+
// performant! They should compile to just "move" instructions on all supported
291+
// compilers and platforms.
292+
293+
// We use memcpy to let the C compiler handle unaligned accesses and endianness
294+
// issues for us. It also seems to produce better code than manual copying for
295+
// most compilers (see https://blog.regehr.org/archives/959 for more info).
297296

298297
static inline void
299298
write_u32(uint16_t *p, uint32_t val)

0 commit comments

Comments
 (0)