My previous fix triggered another issue: apparently at least GCC expects
the `_Pragma` operator to be placed in its own statement (after a
semicolon). The current macro simply dumped the expression and the
_Pragma together, triggering an error. Putting a semicolon after `Expr`
fixes the issue (actually double-checked after a `git clean -fdx`),
although slightly changing the API (the semicolon after the wrapped
macros is now optional).
It looks like the actual macro defined by GCC is `__GNUC__`.
From my testing, `__GNU__` does not seem to be defined neither on my
musl machine nor a Fedora Linux VM. I have no idea if it's a typo or set
by specific libraries, but testing for `__GNUC__` actually suppresses
shadowing errors on my end.
- Introduce both s_imageCache and s_krnlCache on all platforms, even if unused (will be reused later to unify platforms handling)
- This means that what userland images that used to be unsorted are now sorted
The name was a bit misleading as it could be mistaken to mean "The cache contains the address" and not as "has an image with this start address". ie: that it could be mistaken to do GetImageForAddress( startAddress ) != nullptr.
This disables the warnings for MSVC, GCC and Clang in the ZoneScopedXX
macros.
The warnings produced are both a false positive since they didn't find a
bug *and* they don't happen in user written code, so the user couldn't
even do much about it. The previous workaround of using ZoneNamedXXX is
a poor solution since the Zone(Text|Name|etc.) macros all rely on the
`___tracy_scoped_zone` name.
`ZoneNameF(fmt, ...)` was error-prone: if the format is inconsistent
with arguments, the code compiled fine without errors or warnings.
Use gcc/clang `__attribute__((format(printf, fmt_idx, arg_idx)))`
function attribute, so that `ZoneNameF(fmt, ...)` can now check
at compilation time the consistency between the format and the
arguments.
See https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Function-Attributes.html
In Profiler::DequeueSerial if AppendData fails part way through m_serialDequeue then the elements could be freed again in Profiler::ClearSerial, which leads to memory corruption in rpmalloc.
This provides some instructions and tips for the manual. Also:
* Made the calibration feature a CMake option
* Cleaned up some minor code issues
* Fixed an issue with the calibration
* Incremented patch number