MCPcopy Create free account
hub / github.com/catboost/catboost / AllocateAndAdd

Method AllocateAndAdd

library/cpp/yt/memory/ref.cpp:517–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517TMutableRef TSharedRefArrayBuilder::AllocateAndAdd(size_t size)
518{
519 YT_ASSERT(CurrentPartIndex_ < Impl_->Size());
520 YT_ASSERT(CurrentAllocationPtr_ + size <= Impl_->GetBeginAllocationPtr() + AllocationCapacity_);
521 TMutableRef ref(CurrentAllocationPtr_, size);
522 CurrentAllocationPtr_ += size;
523 TSharedRangeHolderPtr holder(Impl_.Get(), false);
524 TSharedRef sharedRef(ref, std::move(holder));
525 Add(std::move(sharedRef));
526 return ref;
527}
528
529TSharedRefArray TSharedRefArrayBuilder::Finish()
530{

Callers 1

MakeCopyMethod · 0.80

Calls 5

GetBeginAllocationPtrMethod · 0.80
moveFunction · 0.50
AddFunction · 0.50
SizeMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected