This is an archive of the discontinued LLVM Phabricator instance.

Add a RingBuffer class to sanitizer_common
ClosedPublic

Authored by kcc on Aug 23 2018, 4:38 PM.

Event Timeline

kcc created this revision.Aug 23 2018, 4:38 PM
Herald added subscribers: Restricted Project, delcypher, mgorny, kubamracek. · View Herald TranscriptAug 23 2018, 4:38 PM
kcc updated this revision to Diff 162970.Aug 28 2018, 3:32 PM

Rewrite RingBuffer using a different approach (suggested by eugenis@)

eugenis added inline comments.Aug 28 2018, 3:41 PM
lib/sanitizer_common/sanitizer_ring_buffer.h
30

I think you need to check that sizeof(T) is divisible by sizeof(void*), otherwise wrap-around check is not correct.

51

I think this is UB.

59

delete copy constructor?

kcc updated this revision to Diff 162974.Aug 28 2018, 3:49 PM

address comments

lib/sanitizer_common/sanitizer_ring_buffer.h
30

done

51

done

59

done

kcc updated this revision to Diff 162977.Aug 28 2018, 3:56 PM

updated a comment

eugenis accepted this revision.Aug 28 2018, 4:31 PM

LGTM, thanks!

This revision is now accepted and ready to land.Aug 28 2018, 4:31 PM
This revision was automatically updated to reflect the committed changes.