mirror of
https://github.com/rui314/mold.git
synced 2024-12-28 02:44:48 +03:00
wip
This commit is contained in:
parent
b1f5b4f9b7
commit
7dbfb01b10
@ -115,7 +115,7 @@ static void mark(tbb::concurrent_vector<InputSection *> roots) {
|
|||||||
|
|
||||||
// Remove unreachable sections
|
// Remove unreachable sections
|
||||||
static void sweep() {
|
static void sweep() {
|
||||||
Timer t3("sweep");
|
Timer t("sweep");
|
||||||
static Counter counter("garbage_sections");
|
static Counter counter("garbage_sections");
|
||||||
|
|
||||||
tbb::parallel_for_each(out::objs, [&](ObjectFile *file) {
|
tbb::parallel_for_each(out::objs, [&](ObjectFile *file) {
|
||||||
|
3
main.cc
3
main.cc
@ -889,6 +889,9 @@ int main(int argc, char **argv) {
|
|||||||
on_complete = fork_child();
|
on_complete = fork_child();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.print_stats)
|
||||||
|
Counter::enabled = true;
|
||||||
|
|
||||||
for (std::string_view arg : config.trace_symbol)
|
for (std::string_view arg : config.trace_symbol)
|
||||||
Symbol::intern(arg)->traced = true;
|
Symbol::intern(arg)->traced = true;
|
||||||
|
|
||||||
|
8
mold.h
8
mold.h
@ -1102,17 +1102,21 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Counter &operator++(int) {
|
Counter &operator++(int) {
|
||||||
values.local()++;
|
if (enabled)
|
||||||
|
values.local()++;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Counter &operator+=(int delta) {
|
Counter &operator+=(int delta) {
|
||||||
values.local() += delta;
|
if (enabled)
|
||||||
|
values.local() += delta;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print();
|
static void print();
|
||||||
|
|
||||||
|
static inline bool enabled = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
i64 get_value();
|
i64 get_value();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user