-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The profiler just collects loaded files (as NSData) and then sends them to CBA to generate the report. Note the code runs json parsing on all the files, and demangle OptFunction again, and then prints the results to the console via fprintf. Will tie to some UI or report.
- Loading branch information
Showing
15 changed files
with
49,309 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Clang Build Analyzer https://github.com/aras-p/ClangBuildAnalyzer | ||
// SPDX-License-Identifier: Unlicense | ||
#pragma once | ||
|
||
#include "BuildEvents.h" | ||
#include <stdio.h> | ||
|
||
void DoAnalysis(const BuildEvents& events, BuildNames& names, FILE* out); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Clang Build Analyzer https://github.com/aras-p/ClangBuildAnalyzer | ||
// SPDX-License-Identifier: Unlicense | ||
|
||
#include <cstdint> | ||
#include <algorithm> | ||
#include <vector> | ||
|
||
struct ArenaBlock | ||
{ | ||
uint8_t* buffer; | ||
size_t bufferSize; | ||
size_t used; | ||
}; | ||
|
||
static std::vector<ArenaBlock> s_Blocks; | ||
|
||
const size_t kDefaultBlockSize = 65536; | ||
|
||
|
||
void ArenaInitialize() | ||
{ | ||
} | ||
|
||
void ArenaDelete() | ||
{ | ||
for (auto& b : s_Blocks) | ||
delete[] b.buffer; | ||
s_Blocks.clear(); | ||
} | ||
|
||
void* ArenaAllocate(size_t size) | ||
{ | ||
// do we need a new block? | ||
if (s_Blocks.empty() || s_Blocks.back().used + size > s_Blocks.back().bufferSize) | ||
{ | ||
ArenaBlock block; | ||
block.bufferSize = std::max(size, kDefaultBlockSize); | ||
block.buffer = new uint8_t[block.bufferSize]; | ||
block.used = 0; | ||
s_Blocks.emplace_back(block); | ||
} | ||
|
||
// allocate from the last block | ||
ArenaBlock& b = s_Blocks.back(); | ||
void* ptr = b.buffer + b.used; | ||
b.used += size; | ||
return ptr; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Clang Build Analyzer https://github.com/aras-p/ClangBuildAnalyzer | ||
// SPDX-License-Identifier: Unlicense | ||
#pragma once | ||
|
||
void ArenaInitialize(); | ||
void ArenaDelete(); | ||
void* ArenaAllocate(size_t size); |
Oops, something went wrong.