These are chat archives for HdrHistogram/HdrHistogram

Sep 2015
Sep 15 2015 22:01 UTC

@mikeb01 was looking at your C code for the zigzag encoding and was wondering if this was correct:
data_index += zig_zag_encode_i64(&encoded->counts[data_index], htole64(-zeros));
data_index += zig_zag_encode_i64(&encoded->counts[data_index], htole64(value));
I was puzzled by why the need to convert the value to le since the function called operates on the cpu value (which requires native encoding of the value)?
The code will work fine on LE (where the macro is a no-op) but should break on BE architecture. Seems like htole64 should not be used...

If you don't mind I'll copy over your 2 zigzag encode/decode functions as I will need them in the C extension for python.

Michael Barker
Sep 15 2015 22:34 UTC
@ahothan I'll double check that this evening. I have an arm that I can test it on. No problem copying the code.