GeezerVison is showing github.com — src: introduce DCHECK macro · nodejs/node@99a5af6
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/aliased_buffer.h +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -231,9 +231,7 @@ class AliasedBuffer { |
231 | 231 | void reserve(size_t new_capacity) { |
232 | 232 | DCHECK_GE(new_capacity, count_); |
233 | 233 | DCHECK_EQ(byte_offset_, 0); |
234 | | -#if defined(DEBUG) && DEBUG |
235 | | - CHECK(free_buffer_); |
236 | | -#endif |
| 234 | + DCHECK(free_buffer_); |
237 | 235 | const v8::HandleScope handle_scope(isolate_); |
238 | 236 |
|
239 | 237 | const size_t old_size_in_bytes = sizeof(NativeT) * count_; |
|
Collapse file
Copy file name to clipboardExpand all lines: src/base_object-inl.h +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -113,9 +113,7 @@ void BaseObject::ClearWeak() { |
113 | 113 | v8::Local<v8::FunctionTemplate> |
114 | 114 | BaseObject::MakeLazilyInitializedJSTemplate(Environment* env) { |
115 | 115 | auto constructor = [](const v8::FunctionCallbackInfo<v8::Value>& args) { |
116 | | -#ifdef DEBUG |
117 | | - CHECK(args.IsConstructCall()); |
118 | | -#endif |
| 116 | + DCHECK(args.IsConstructCall()); |
119 | 117 | DCHECK_GT(args.This()->InternalFieldCount(), 0); |
120 | 118 | args.This()->SetAlignedPointerInInternalField(0, nullptr); |
121 | 119 | }; |
|
Collapse file
Copy file name to clipboardExpand all lines: src/inspector/node_string.h -4Lines changed: 0 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -73,8 +73,4 @@ extern size_t kNotFound; |
73 | 73 | } // namespace inspector |
74 | 74 | } // namespace node |
75 | 75 |
|
76 | | -#ifndef DCHECK |
77 | | - #define DCHECK CHECK |
78 | | - #define DCHECK_LT CHECK_LT |
79 | | -#endif // DCHECK |
80 | 76 | #endif // SRC_INSPECTOR_NODE_STRING_H_ |
Collapse file
Copy file name to clipboardExpand all lines: src/string_decoder.cc +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -44,9 +44,7 @@ MaybeLocal<String> MakeString(Isolate* isolate, |
44 | 44 | isolate->ThrowException(error); |
45 | 45 | } |
46 | 46 |
|
47 | | -#ifdef DEBUG |
48 | | - CHECK(ret.IsEmpty() || ret.ToLocalChecked()->IsString()); |
49 | | -#endif |
| 47 | + DCHECK(ret.IsEmpty() || ret.ToLocalChecked()->IsString()); |
50 | 48 | return ret.FromMaybe(Local<Value>()).As<String>(); |
51 | 49 | } |
52 | 50 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: src/util.h +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -130,6 +130,7 @@ void DumpBacktrace(FILE* fp); |
130 | 130 | #define CHECK_IMPLIES(a, b) CHECK(!(a) || (b)) |
131 | 131 |
|
132 | 132 | #ifdef DEBUG |
| 133 | + #define DCHECK(expr) CHECK(expr) |
133 | 134 | #define DCHECK_EQ(a, b) CHECK((a) == (b)) |
134 | 135 | #define DCHECK_GE(a, b) CHECK((a) >= (b)) |
135 | 136 | #define DCHECK_GT(a, b) CHECK((a) > (b)) |
@@ -140,6 +141,7 @@ void DumpBacktrace(FILE* fp); |
140 | 141 | #define DCHECK_NOT_NULL(val) CHECK((val) != nullptr) |
141 | 142 | #define DCHECK_IMPLIES(a, b) CHECK(!(a) || (b)) |
142 | 143 | #else |
| 144 | + #define DCHECK(expr) |
143 | 145 | #define DCHECK_EQ(a, b) |
144 | 146 | #define DCHECK_GE(a, b) |
145 | 147 | #define DCHECK_GT(a, b) |
|