Fix ep_rt_atomic_compare_exchange_size_t in Mono EventPipe shim. (#58369)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 31 Aug 2021 19:55:37 +0000 (12:55 -0700)
committerGitHub <noreply@github.com>
Tue, 31 Aug 2021 19:55:37 +0000 (12:55 -0700)
commit5ed210c0f242e94877a35ac805931cf15f389174
tree0d6bc6d947e8a0b76890e432416099005290f1a4
parentaaba084efde05f1ee7f24237a1511a82e1e33ed0
Fix ep_rt_atomic_compare_exchange_size_t in Mono EventPipe shim. (#58369)

ep_rt_atomic_compare_exchange_size_t was always truncated to gint32 on
Mono 64-bit platforms. This commit use 32 or 64-bit cas version
depending on SIZEOF_SIZE_T. NOTE, CoreCLR used a template function for
this and already picks 32 or 64 bit version depending on size of size_t.

ep_rt_atomic_compare_exchange_size_t is currently used to reflect size
of EventPipe buffer manager buffers and will most likely never need
more than 2GB of data, but better to fix it and inline with CoreCLR shim
implementation.

Co-authored-by: lateralusX <lateralusx.github@gmail.com>
src/mono/mono/eventpipe/ep-rt-mono.h