From: Nathan Ricci Date: Fri, 21 Feb 2020 18:50:55 +0000 (-0500) Subject: Added some parenthesis and a cast to control order of operations. (#32640) X-Git-Tag: submit/tizen/20210909.063632~9563 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58cf1468e1d9519c3752dfd40402eb4fda6fb9e9;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Added some parenthesis and a cast to control order of operations. (#32640) Fix intermittent negative values from GetTotalBytesAllocated. --- diff --git a/src/mono/mono/metadata/sgen-mono.c b/src/mono/mono/metadata/sgen-mono.c index 038f435..d9baf86 100644 --- a/src/mono/mono/metadata/sgen-mono.c +++ b/src/mono/mono/metadata/sgen-mono.c @@ -2639,7 +2639,7 @@ mono_gc_get_allocated_bytes_for_current_thread (void) info = mono_thread_info_current (); /*There are some more allocated bytes in the current tlab that have not been recorded yet */ - return info->total_bytes_allocated + info->tlab_next - info->tlab_start; + return info->total_bytes_allocated + (ptrdiff_t)(info->tlab_next - info->tlab_start); } guint64