diff options
author | Francisco Jerez <currojerez@riseup.net> | 2017-04-07 18:50:03 -0700 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2017-04-07 20:17:46 -0700 |
commit | 7ada015bffef703d3c4a90eb49f4e7cdfc22821e (patch) | |
tree | 645f77ddf95467c9350cdbebee747d690df6338f | |
parent | 0e220c1a765372f7e56b330710585494c0600874 (diff) |
Uses global thread-unsafe memory pool. Might race in multithreaded
environment.
-rw-r--r-- | lib/trace/trace_model.cpp | 2 | ||||
-rw-r--r-- | lib/trace/trace_model.hpp | 2 | ||||
-rw-r--r-- | retrace/glretrace.py | 2 | ||||
-rw-r--r-- | retrace/retrace.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/trace/trace_model.cpp b/lib/trace/trace_model.cpp index 9a98eac3..3ed453e8 100644 --- a/lib/trace/trace_model.cpp +++ b/lib/trace/trace_model.cpp @@ -29,7 +29,7 @@ #include "trace_model.hpp" -thread_local memory_pool<512> pool; +memory_pool<512> pool; namespace trace { diff --git a/lib/trace/trace_model.hpp b/lib/trace/trace_model.hpp index 68ea3e56..f35d12b8 100644 --- a/lib/trace/trace_model.hpp +++ b/lib/trace/trace_model.hpp @@ -39,7 +39,7 @@ #include "memory_pool.hpp" -extern thread_local memory_pool<512> pool; +extern memory_pool<512> pool; template<typename T> using pool_allocator = memory_pool<512>::allocator<T>; diff --git a/retrace/glretrace.py b/retrace/glretrace.py index e3fa346d..0c8bcb60 100644 --- a/retrace/glretrace.py +++ b/retrace/glretrace.py @@ -270,7 +270,7 @@ class GlRetracer(Retracer): # TODO: handle BufferData variants # TODO: don't rely on GL_ARB_direct_state_access if function.name in ('glDeleteBuffers', 'glDeleteBuffersARB'): - print r' if (currentContext->features().ARB_direct_state_access) {' + print r' if (currentContext && currentContext->features().ARB_direct_state_access) {' print r' for (GLsizei i = 0; i < n; ++i) {' print r' GLvoid *ptr = nullptr;' print r' glGetNamedBufferPointerv(buffers[i], GL_BUFFER_MAP_POINTER, &ptr);' diff --git a/retrace/retrace.py b/retrace/retrace.py index 136a4343..da5a79a3 100644 --- a/retrace/retrace.py +++ b/retrace/retrace.py @@ -109,7 +109,7 @@ class ValueAllocator(stdapi.Visitor): class ValueDeserializer(stdapi.Visitor, stdapi.ExpanderMixin): def visitLiteral(self, literal, lvalue, rvalue): - print ' %s = (%s).to%s();' % (lvalue, rvalue, literal.kind) + print ' %s = static_cast<const trace::%s *>(&%s)->value;' % (lvalue, literal.kind, rvalue) def visitConst(self, const, lvalue, rvalue): self.visit(const.type, lvalue, rvalue) |