On Linux `/sys` is not guaranteed to exist. When it doesn't, tracy
would crash with a SIGSEGV due to a nullptr dereference. Not actually
sure how well tracy clients will handle the case where this information
is missing, though.
This enables better bindings in languages that do not have 0-terminated
strings for source/function name. It does not introduce any additional
overhead in languages that do use 0-terminated strings, either, but it
_is_ a breaking API change.
Fixes https://github.com/wolfpld/tracy/issues/53
This function needs to be called for each non-main thread before calling
the `___tracy_alloc_` functions.
Alternative way to achieve this could be initializing the allocator
transparently in the `___tracy_alloc_*` calls.
Instantiating Tracy from within a DLL will tie its internal threads life-time to the DLL. Windows does not guarantee
that threads will be alive after the main function. This has implications in the Profiler dtor since will try to perform
some deallocations, however, _memory_deallocate_large will try to get the heap of the current thread which can
be invalid at the point of shutdown causing a crash. Checking the pointer here will won't make TRACE_NO_EXIT
work, but it will prevent the Profiler from crashing.
- Wrapping FORCEINLINE & WIN32_LEAN_AND_MEAN definess with ifndef bc other libraries may define it and trigger redefinition warning
- Possibly contentious given tone in the manual (:P) but removing variable shadowing in TracySysTrace.cpp
- Alternate Solution: Add #define TRACY_FORCE_SILENT_WARNINGS toggle-able flag. If flag is enabled, push/pop warning disables that have to be included in client code
This fixes problems with first context switch data region possibly not being
available for the main thread, if no rescheduling was performed after sys
tracing has started.