[PATCH] D54989: [XRay] Move-only Allocator, FunctionCallTrie, and Array
Dean Michael Berris via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 28 00:33:01 PST 2018
dberris added inline comments.
================
Comment at: compiler-rt/lib/xray/xray_segmented_array.h:351
- size_t size() const XRAY_NEVER_INSTRUMENT { return Size; }
-
- T *Append(const T &E) XRAY_NEVER_INSTRUMENT {
- if (UNLIKELY(Head == &SentinelSegment))
- if (InitHeadAndTail() == nullptr)
- return nullptr;
-
- auto Offset = Size % ElementsPerSegment;
- if (UNLIKELY(Size != 0 && Offset == 0))
- if (AppendNewSegment() == nullptr)
- return nullptr;
-
- auto Base = static_cast<Segment *>(Tail)->Data;
- auto AlignedOffset = Base + (Offset * AlignedElementStorageSize);
- auto Position = reinterpret_cast<T *>(AlignedOffset);
- *Position = E;
- ++Size;
- return Position;
- }
+ uint64_t size() const XRAY_NEVER_INSTRUMENT { return Size; }
----------------
mboerger wrote:
> why change size?
Was experimenting with seeing whether layout was affected by picking an explicit 64-bit unsigned as opposed to using size_t. Forgot to revert. :)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54989/new/
https://reviews.llvm.org/D54989
More information about the llvm-commits
mailing list