Patch 9.0.1567

4 views
Skip to first unread message

Bram Moolenaar

unread,
May 19, 2023, 8:21:51 AM5/19/23
to vim...@googlegroups.com

Patch 9.0.1567
Problem: Profiler calculation may be wrong on 32 bit builds.
Solution: Use 64 bit variable if possible. (Isao Sato, closes #12412)
Files: src/profiler.c


*** ../vim-9.0.1566/src/profiler.c 2023-03-22 22:03:11.939208261 +0000
--- src/profiler.c 2023-05-19 13:18:10.536419710 +0100
***************
*** 123,132 ****
QueryPerformanceFrequency(&fr);
tm->QuadPart += (LONGLONG)((double)msec / 1000.0 * (double)fr.QuadPart);
# else
! long fsec;

PROF_GET_TIME(tm);
! fsec = (long)tm->tv_fsec + (long)msec * (TV_FSEC_SEC / 1000);
tm->tv_fsec = fsec % (long)TV_FSEC_SEC;
tm->tv_sec += fsec / (long)TV_FSEC_SEC;
# endif
--- 123,133 ----
QueryPerformanceFrequency(&fr);
tm->QuadPart += (LONGLONG)((double)msec / 1000.0 * (double)fr.QuadPart);
# else
! varnumber_T fsec; // this should be 64 bit if possible

PROF_GET_TIME(tm);
! fsec = (varnumber_T)tm->tv_fsec
! + (varnumber_T)msec * (varnumber_T)(TV_FSEC_SEC / 1000);
tm->tv_fsec = fsec % (long)TV_FSEC_SEC;
tm->tv_sec += fsec / (long)TV_FSEC_SEC;
# endif
*** ../vim-9.0.1566/src/version.c 2023-05-18 20:07:08.672843369 +0100
--- src/version.c 2023-05-19 13:20:05.307771314 +0100
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1567,
/**/

--
"Oh, no! NOT the Spanish Inquisition!"
"NOBODY expects the Spanish Inquisition!!!"
-- Monty Python sketch --
"Oh, no! NOT another option!"
"EVERYBODY expects another option!!!"
-- Discussion in vim-dev mailing list --

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages