Skip to content

Commit 05da933

Browse files
authored
Merge pull request #41329 from mikeash/no-linux-explicit-bzero
[Concurrency] Remove explicit_bzero call on Linux.
2 parents 5e1e0c1 + 6f923f3 commit 05da933

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

stdlib/public/runtime/StackAllocator.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,12 @@ class StackAllocator {
128128
/// Clear the fake metadata pointer. Call before freeing so that leftover
129129
/// heap garbage doesn't have slab metadata pointers in it.
130130
void clearMetadata() {
131-
// Use memset_s or explicit_bzero where available. Fall back to a plain
132-
// assignment on unknown platforms. This is not necessary for correctness,
133-
// just as an aid to analysis tools, so it's OK if the fallback gets
134-
// optimized out.
131+
// Use memset_s on Apple platforms. Fall back to a plain
132+
// assignment on other platforms. This is not necessary for
133+
// correctness, just as an aid to analysis tools, so it's OK if
134+
// the fallback gets optimized out.
135135
#if defined(__APPLE__)
136136
memset_s(&metadata, sizeof(metadata), 0, sizeof(metadata));
137-
#elif defined(__linux__)
138-
explicit_bzero(&metadata, sizeof(metadata));
139137
#else
140138
metadata = 0;
141139
#endif

0 commit comments

Comments
 (0)