mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 17:47:22 +03:00
Fix uninitialized nstime reading / updating on the stack in hpa.
In order for nstime_update to handle non-monotonic clocks, it requires the input nstime to be initialized -- when reading for the first time, zero init has to be done. Otherwise random stack value may be seen as clocks and returned.
This commit is contained in:
parent
8b81d3f214
commit
400c59895a
4 changed files with 15 additions and 9 deletions
|
|
@ -349,7 +349,7 @@ defer_test_dehugify(void *ptr, size_t size) {
|
|||
|
||||
static nstime_t defer_curtime;
|
||||
static void
|
||||
defer_test_curtime(nstime_t *r_time) {
|
||||
defer_test_curtime(nstime_t *r_time, bool first_reading) {
|
||||
*r_time = defer_curtime;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue