简体   繁体   中英

Need help to solve access violation error of hdr histogram C++

Recently started attempting to use hdr_histogram in C++. Works like a charm in unix. But the same program breaks in Windows (Visual Studio 2017). Throws "Access violation" while calling hdr reset (hdr_interval_recorder.inactive). inactive is NULL, while in unix, it's not. I did call hdr_interval_recoder_init_all on the hdr_interval_recorder before this. Any suggestions on what I should start looking at?

I was using an older version of hdr_histogram. Instead of calling hdr_reset(hdr_histogram*) and then calling hdr_interval_recorder_sample(), now we can call hdr_interval_recorder_sample_and_recycle(), which handles the case when the hdr_histogram pointer is NULL, which was the case when I was calling hdr_reset(). Honestly, still haven't figured out why their API was initialization inactive in unix and not in windows, but I can circumvent the problem using their new API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM