Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 std::size_t elementSize,
23 std::size_t nElements)
24{
25 R__ASSERT((elementSize > 0) && (nElements > 0));
26 auto nbytes = elementSize * nElements;
27 auto buffer = new unsigned char[nbytes];
28 return RPage(columnId, buffer, elementSize, nElements);
29}
30
32{
33 if (!page.IsPageZero())
34 delete[] reinterpret_cast<unsigned char *>(page.GetBuffer());
35}
#define R__ASSERT(e)
Definition TError.h:118
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.