Skip to content

Commit 447abda

Browse files
silvaseanbjacob
authored andcommitted
Increase ProfilingStack::kMaxSize
I ran into this limit with a real application that was hooking into gemmlowp's instrumentation. 30 is the next available number after 14, due to the static_assert that sizeof(ProfilingStack) must be a power of 2. There are 2 pointer-sized objects in Profiling stack, and then kMaxSize pointers. Thus, 14+2 == 16, to increase it, the next available total size is 32, hence kMaxSize == 30.
1 parent 12fed0c commit 447abda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

profiling/instrumentation.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ struct ScopedLock {
108108
// contains pointers to literal strings that were manually entered
109109
// in the instrumented code (see ScopedProfilingLabel).
110110
struct ProfilingStack {
111-
static const std::size_t kMaxSize = 14;
111+
static const std::size_t kMaxSize = 30;
112112
typedef const char* LabelsArrayType[kMaxSize];
113113
LabelsArrayType labels;
114114
std::size_t size;

0 commit comments

Comments
 (0)