From f5a474c88996970188d148edde1b0f94b2d9926b Mon Sep 17 00:00:00 2001 From: Denis Bakhvalov Date: Fri, 15 Mar 2024 17:32:52 -0400 Subject: [PATCH] [Chapter8] Section about alignment: minor edits --- .../8-2 Cache-Friendly Data Structures.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapters/8-Optimizing-Memory-Accesses/8-2 Cache-Friendly Data Structures.md b/chapters/8-Optimizing-Memory-Accesses/8-2 Cache-Friendly Data Structures.md index b8e082fccf..65b0a24518 100644 --- a/chapters/8-Optimizing-Memory-Accesses/8-2 Cache-Friendly Data Structures.md +++ b/chapters/8-Optimizing-Memory-Accesses/8-2 Cache-Friendly Data Structures.md @@ -125,8 +125,8 @@ Listing: Data padding to avoid false sharing. ~~~~ {#lst:PadFalseSharing .cpp} #define CACHELINE_ALIGN alignas(64) struct S { struct S { - int a; // written by thread A => int a; - int b; // written by thread B CACHELINE_ALIGN int b; + int a; /* modified by thread A */ => int a; + int b; /* modified by thread B */ CACHELINE_ALIGN int b; }; }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~