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
21#include <algorithm>
22
24ROOT::Experimental::Internal::RPageAllocatorHeap::NewPage(std::size_t elementSize, std::size_t nElements)
25{
26 R__ASSERT((elementSize > 0) && (nElements > 0));
27 auto nbytes = elementSize * nElements;
28 auto buffer = new unsigned char[nbytes];
29 return RPage(buffer, this, elementSize, nElements);
30}
31
33{
34 delete[] reinterpret_cast<unsigned char *>(page.GetBuffer());
35}
#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:47