mattreecebentley / plf_list

A drop-in replacement for std::list with 293% faster insertion, 57% faster erasure, 17% faster iteration and 77% faster sorting on average. 20-24% speed increase in use-case testing.
https://plflib.org/list.htm
zlib License
151 stars 21 forks source link

Fixes for memory errors #5

Closed cscrimge closed 6 years ago

cscrimge commented 6 years ago

I ran some tests of plf_list with GCC's -fsanitize=undefined and -fsanitize=address, and found a few issues:

plf_sanitize.patch.txt

mattreecebentley commented 6 years ago

I appreciate you doing this, The first one is annoying, but unfortunately true - apparently some compilers will bork if the source pointer is NULL, even if size == 0 (https://stackoverflow.com/questions/5243012/is-it-guaranteed-to-be-safe-to-perform-memcpy0-0-0). Fixed in most recent commit. The second and third were already addressed in the last two commits a few days ago, so you must be using an older version than that. The last is correct, I have fixed in most recent commit. Once again, thanks for taking the time-