Commit 4da376b5 authored by Kevin Modzelewski's avatar Kevin Modzelewski

make format

parent 8a3a1792
......@@ -214,12 +214,13 @@ threading::PerThreadSet<root_stack_t> root_stack_set;
void gatherInterpreterRoots(GCVisitor* visitor) {
root_stack_set.forEachValue(std::function<void(root_stack_t*, GCVisitor*)>([](root_stack_t* v, GCVisitor* visitor) {
for (const SymMap* sym_map : *v) {
for (const auto& p2 : *sym_map) {
visitor->visitPotential(p2.second.o);
}
}
}), visitor);
for (const SymMap* sym_map : *v) {
for (const auto& p2 : *sym_map) {
visitor->visitPotential(p2.second.o);
}
}
}),
visitor);
}
class UnregisterHelper {
......
......@@ -56,7 +56,6 @@ public:
void log(int count = 1) { Stats::log(id, count); }
};
}
#endif
......@@ -123,16 +123,11 @@ public:
namespace impl {
// From http://stackoverflow.com/questions/7858817/unpacking-a-tuple-to-call-a-matching-function-pointer
template<int ...>
struct seq { };
template <int...> struct seq {};
template<int N, int ...S>
struct gens : gens<N-1, N-1, S...> { };
template <int N, int... S> struct gens : gens<N - 1, N - 1, S...> {};
template<int ...S>
struct gens<0, S...> {
typedef seq<S...> type;
};
template <int... S> struct gens<0, S...> { typedef seq<S...> type; };
}
template <typename T, typename... CtorArgs> class PerThreadSet {
......@@ -141,7 +136,7 @@ private:
PthreadFastMutex lock;
struct Storage {
PerThreadSet<T, CtorArgs...> *self;
PerThreadSet<T, CtorArgs...>* self;
T val;
};
......@@ -163,9 +158,8 @@ private:
delete s;
}
template <int ...S>
Storage* make(impl::seq<S...>) {
return new Storage {.self=this, .val=T(std::get<S>(ctor_args)...) };
template <int... S> Storage* make(impl::seq<S...>) {
return new Storage{ .self = this, .val = T(std::get<S>(ctor_args)...) };
}
public:
......@@ -181,8 +175,7 @@ public:
}
}
template <typename... Arguments>
void forEachValue(std::function<void(T*, Arguments...)> f, Arguments... args) {
template <typename... Arguments> void forEachValue(std::function<void(T*, Arguments...)> f, Arguments... args) {
LOCK_REGION(&lock);
for (auto& p : map) {
......
......@@ -160,13 +160,13 @@ void runCollection() {
if (VERBOSITY("gc") >= 2)
printf("Collection #%d\n", ++ncollections);
//Timer _t2("promoting", /*min_usec=*/10000);
// Timer _t2("promoting", /*min_usec=*/10000);
threading::GLPromoteRegion _lock;
//long promote_us = _t2.end();
//static thread_local StatPerThreadCounter sc_promoting_us("gc_promoting_us");
//sc_promoting_us.log(promote_us);
// long promote_us = _t2.end();
// static thread_local StatPerThreadCounter sc_promoting_us("gc_promoting_us");
// sc_promoting_us.log(promote_us);
Timer _t("collecting", /*min_usec=*/10000);
......
......@@ -90,9 +90,7 @@ private:
Heap* heap;
Block* cache_heads[NUM_BUCKETS];
ThreadBlockCache(Heap* heap) : heap(heap) {
memset(cache_heads, 0, sizeof(cache_heads));
}
ThreadBlockCache(Heap* heap) : heap(heap) { memset(cache_heads, 0, sizeof(cache_heads)); }
~ThreadBlockCache();
};
friend class ThreadBlockCache;
......@@ -100,8 +98,7 @@ private:
threading::PerThreadSet<ThreadBlockCache, Heap*> thread_caches;
public:
Heap() : thread_caches(this) {
}
Heap() : thread_caches(this) {}
void* realloc(void* ptr, size_t bytes);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment