OmniSciDB  04ee39c94c
checked_alloc.h File Reference
#include <boost/stacktrace.hpp>
#include <cstdlib>
#include <ostream>
#include <stdexcept>
#include <string>
#include "../Shared/types.h"
#include "Shared/Logger.h"
+ Include dependency graph for checked_alloc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  OutOfHostMemory
 
struct  CheckedAllocDeleter
 

Macros

#define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED   1
 

Functions

void * checked_malloc (const size_t size)
 
void * checked_calloc (const size_t nmemb, const size_t size)
 

Macro Definition Documentation

◆ BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED

#define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED   1

Definition at line 20 of file checked_alloc.h.

Function Documentation

◆ checked_calloc()

void* checked_calloc ( const size_t  nmemb,
const size_t  size 
)
inline

Definition at line 48 of file checked_alloc.h.

References OutOfHostMemory::OutOfHostMemory().

Referenced by QueryMemoryInitializer::allocateCountDistinctBitmap(), anonymous_namespace{Execute.cpp}::fill_entries_for_empty_input(), WindowFunctionContext::fillPartitionEnd(), WindowFunctionContext::fillPartitionStart(), InValuesBitmap::InValuesBitmap(), ResultSet::ResultSet(), and ResultSet::syncEstimatorBuffer().

48  {
49  auto ptr = calloc(nmemb, size);
50  if (!ptr) {
51  throw OutOfHostMemory(nmemb * size);
52  }
53  return ptr;
54 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checked_malloc()

void* checked_malloc ( const size_t  size)
inline

Definition at line 40 of file checked_alloc.h.

References OutOfHostMemory::OutOfHostMemory().

Referenced by Importer_NS::TypedImportBuffer::add_values(), Importer_NS::TypedImportBuffer::addDictEncodedStringArray(), anonymous_namespace{QueryMemoryInitializer.cpp}::alloc_group_by_buffer(), NumericValueConverter< int64_t, TARGET_TYPE >::allocateColumnarBuffer(), NumericValueConverter< int64_t, TARGET_TYPE >::allocateColumnarData(), QueryMemoryInitializer::allocateCountDistinctGpuMem(), ResultSet::allocateStorage(), ColumnarResults::ColumnarResults(), WindowFunctionContext::compute(), Fragmenter_Namespace::DateChunkConverter< BUFFER_DATA_TYPE >::DateChunkConverter(), Executor::executeSimpleInsert(), ColumnFetcher::getAllColumnFragments(), ResultSet::getTargetValueFromBufferRowwise(), ColumnarResults::mergeResults(), Importer_NS::NullArray(), DictionaryValueConverter< TARGET_TYPE >::processBuffer(), QueryMemoryInitializer::QueryMemoryInitializer(), Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::ScalarChunkConverter(), Importer_NS::StringToArray(), Importer_NS::TDatumToArrayDatum(), to_array_datum(), and GeoPointValueConverter::toCompressedCoords().

40  {
41  auto ptr = malloc(size);
42  if (!ptr) {
43  throw OutOfHostMemory(size);
44  }
45  return ptr;
46 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function: