Vowpal Wabbit
Namespaces | Macros | Typedefs | Functions
memory.h File Reference
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <memory>
#include "vw_exception.h"

Namespaces

 VW
 

Macros

#define calloc_mergable_or_throw   calloc_or_throw
 

Typedefs

using free_fn = void(*)(void *)
 
template<class T >
using free_ptr = std::unique_ptr< T, free_fn >
 

Functions

template<class T >
T * calloc_or_throw (size_t nmemb)
 
template<class T >
T & calloc_or_throw ()
 
template<class T >
void destroy_free (void *temp)
 
template<class T , typename... Args>
free_ptr< T > scoped_calloc_or_throw (Args &&... args)
 
template<typename T , typename... Args>
std::unique_ptr< T > VW::make_unique (Args &&... params)
 
void free_it (void *ptr)
 

Macro Definition Documentation

◆ calloc_mergable_or_throw

#define calloc_mergable_or_throw   calloc_or_throw

Typedef Documentation

◆ free_fn

using free_fn = void (*)(void*)

◆ free_ptr

template<class T >
using free_ptr = std::unique_ptr<T, free_fn>

Function Documentation

◆ calloc_or_throw() [1/2]

template<class T >
T* calloc_or_throw ( size_t  nmemb)

◆ calloc_or_throw() [2/2]

template<class T >
T& calloc_or_throw ( )

◆ destroy_free()

template<class T >
void destroy_free ( void *  temp)

◆ free_it()

void free_it ( void *  ptr)
inline

◆ scoped_calloc_or_throw()

template<class T , typename... Args>
free_ptr<T> scoped_calloc_or_throw ( Args &&...  args)