Skip to content

Commit 593d03f

Browse files
authored
Merge pull request #160 from google/cpp-sync
GCC and MSVC fixes.
2 parents f6cff9f + 557e813 commit 593d03f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

base/internal/data.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ enum class DataLocality {
9797
// at least `sizeof(void*)`.
9898
class Data {};
9999

100+
#pragma GCC diagnostic push
101+
#pragma GCC diagnostic ignored "-Wattributes"
102+
100103
// Empty base class indicating class must be stored directly in the handle and
101104
// not allocated separately on the heap.
102105
//
@@ -162,6 +165,8 @@ class HeapData /* : public Data */ {
162165
0;
163166
};
164167

168+
#pragma GCC diagnostic pop
169+
165170
// Provides introspection for `Data`.
166171
class Metadata final {
167172
public:

base/memory_manager.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ std::optional<ArenaBlock> ArenaBlockAllocate(size_t size,
117117
pointer = VirtualAlloc(hint, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
118118
if (ABSL_PREDICT_FALSE(pointer == nullptr)) {
119119
if (hint == nullptr) {
120-
return absl::nullopt;
120+
return std::nullopt;
121121
}
122122
// Try again, without the hint.
123123
pointer =
124124
VirtualAlloc(nullptr, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
125125
if (pointer == nullptr) {
126-
return absl::nullopt;
126+
return std::nullopt;
127127
}
128128
}
129129
#endif

0 commit comments

Comments
 (0)