Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/memoryallocator.hpp

    • Property mode changed from 100644 to 100755
    rf66195 rbe90f1  
    88
    99using namespace std;
    10 
    11 /*********************************************** includes ***********************************/
    1210
    1311// include config.h
     
    2826#include "memoryusageobserver.hpp"
    2927
    30 /********************************************** declarations *******************************/
     28/******************* wrappers for memory allocation functions ***********************/
    3129
    32 /** Allocates a memory range using malloc().
     30/**
     31 * Allocates a memory range using malloc().
    3332 * Prints the provided error message in case of a failure.
    3433 *
     
    5554template <> char* Malloc<char>(size_t size, const char* output);
    5655
    57 /** Allocates a memory range using calloc().
     56/**
     57 * Allocates a memory range using calloc().
    5858 * Prints the provided error message in case of a failure.
    5959 *
     
    7777};
    7878
    79 /** Reallocates a memory range using realloc(). If the provided pointer to the old
     79/**
     80 * Reallocates a memory range using realloc(). If the provided pointer to the old
    8081 * memory range is NULL, malloc() is called instead.
    8182 * Prints the provided error message in case of a failure (of either malloc() or realloc()).
     
    105106};
    106107
    107 /** Frees allocated memory range using free().
     108/**
     109 * Frees allocated memory range using free().
    108110 *
    109111 * \param pointer to the allocated memory range to free; may be NULL, this function is a no-op then
    110  * \param *msg optional error message
    111112 */
    112113template <typename X> void Free(X** buffer, const char *msg = NULL)
     
    115116    return;
    116117
    117   MemoryUsageObserver::getInstance()->removeMemory(*buffer);
     118  MemoryUsageObserver::getInstance()->removeMemory(*buffer, msg);
    118119  free(*buffer);
    119120  *buffer = NULL;
Note: See TracChangeset for help on using the changeset viewer.