Logo ROOT  
Reference Guide
RPageAllocator.cxx
Go to the documentation of this file.
1/// \file RPageAllocator.cxx
2/// \ingroup NTuple ROOT7
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2019-06-25
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16
18
19#include <TError.h>
20
22 ColumnId_t columnId, std::size_t elementSize, std::size_t nElements)
23{
24 R__ASSERT((elementSize > 0) && (nElements > 0));
25 auto nbytes = elementSize * nElements;
26 auto buffer = new unsigned char[nbytes];
27 return RPage(columnId, buffer, nbytes, elementSize);
28}
29
31{
32 delete[] reinterpret_cast<unsigned char *>(page.GetBuffer());
33}
#define R__ASSERT(e)
Definition: TError.h:96
static RPage NewPage(ColumnId_t columnId, std::size_t elementSize, std::size_t nElements)
Reserves memory large enough to hold nElements of the given size.
static void DeletePage(const RPage &page)
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:41
std::int64_t ColumnId_t
Uniquely identifies a physical column within the scope of the current process, used to tag pages.
Definition: RNTupleUtil.hxx:74