Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cpp/velox/jni/VeloxJniWrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_monitor_VeloxMemoryProfiler_start(
JNI_METHOD_START
#ifdef ENABLE_JEMALLOC_STATS
bool active = true;
mallctl("prof.active", NULL, NULL, &active, sizeof(bool));
mallctl("prof.active", nullptr, nullptr, &active, sizeof(bool));
#endif
JNI_METHOD_END()
}
Expand All @@ -618,7 +618,7 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_monitor_VeloxMemoryProfiler_dump(
jclass) {
JNI_METHOD_START
#ifdef ENABLE_JEMALLOC_STATS
mallctl("prof.dump", NULL, NULL, NULL, 0);
mallctl("prof.dump", nullptr, nullptr, nullptr, 0);
#endif
JNI_METHOD_END()
}
Expand All @@ -629,7 +629,7 @@ JNIEXPORT void JNICALL Java_org_apache_gluten_monitor_VeloxMemoryProfiler_stop(
JNI_METHOD_START
#ifdef ENABLE_JEMALLOC_STATS
bool active = false;
mallctl("prof.active", NULL, NULL, &active, sizeof(bool));
mallctl("prof.active", nullptr, nullptr, &active, sizeof(bool));
#endif
JNI_METHOD_END()
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/velox/memory/VeloxMemoryManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ VeloxMemoryManager::~VeloxMemoryManager() {
<< "ms as there are still outstanding memory resources. ";
}
#ifdef ENABLE_JEMALLOC_STATS
malloc_stats_print(NULL, NULL, NULL);
malloc_stats_print(nullptr, nullptr, nullptr);
#endif
}

Expand Down
2 changes: 2 additions & 0 deletions docs/developers/CppCodingStyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ cmake-format --first-comment-is-literal True --in-place cpp/velox/CMakeLists.txt
## Constant

* Prefer const variables to using preprocessor (`#define`) to define constant values.
* Always use nullptr if you need a constant that represents a null pointer (T* for some T);
use 0 otherwise for a zero value.

## Macro

Expand Down