Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
RPageAllocator.cxx
Go to the documentation of this file.
1/// \file RPageAllocator.cxx
2/// \ingroup NTuple
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2019-06-25
5
6/*************************************************************************
7 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
8 * All rights reserved. *
9 * *
10 * For the licensing terms see $ROOTSYS/LICENSE. *
11 * For the list of contributors see $ROOTSYS/README/CREDITS. *
12 *************************************************************************/
13
14
16
17#include <TError.h>
18
19#include <algorithm>
20
22{
23 R__ASSERT((elementSize > 0) && (nElements > 0));
25 auto buffer = new unsigned char[nbytes];
26 return RPage(buffer, this, elementSize, nElements);
27}
28
30{
31 delete[] reinterpret_cast<unsigned char *>(page.GetBuffer());
32}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Definition TError.h:125
RPage NewPage(std::size_t elementSize, std::size_t nElements) final
Reserves memory large enough to hold nElements of the given size.
void DeletePage(RPage &page) final
Releases the memory pointed to by page and resets the page's information.
A page is a slice of a column that is mapped into memory.
Definition RPage.hxx:44