MCPcopy Create free account
hub / github.com/ElementsProject/elements / HeapProfile

Method HeapProfile

src/leveldb/benchmarks/db_bench.cc:897–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

895 }
896
897 void HeapProfile() {
898 char fname[100];
899 snprintf(fname, sizeof(fname), "%s/heap-%04d", FLAGS_db, ++heap_counter_);
900 WritableFile* file;
901 Status s = g_env->NewWritableFile(fname, &file);
902 if (!s.ok()) {
903 fprintf(stderr, "%s\n", s.ToString().c_str());
904 return;
905 }
906 bool ok = port::GetHeapProfile(WriteToFile, file);
907 delete file;
908 if (!ok) {
909 fprintf(stderr, "heap profiling not supported\n");
910 g_env->DeleteFile(fname);
911 }
912 }
913};
914
915} // namespace leveldb

Callers

nothing calls this directly

Calls 4

GetHeapProfileFunction · 0.85
NewWritableFileMethod · 0.45
ToStringMethod · 0.45
DeleteFileMethod · 0.45

Tested by

no test coverage detected