Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'vowpalwabbit/memory.h')
-rw-r--r--vowpalwabbit/memory.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/vowpalwabbit/memory.h b/vowpalwabbit/memory.h
index 6d67d51e..af4c0c4c 100644
--- a/vowpalwabbit/memory.h
+++ b/vowpalwabbit/memory.h
@@ -1,5 +1,4 @@
#pragma once
-
#include <stdlib.h>
#include <iostream>
@@ -18,9 +17,6 @@ T* calloc_or_die(size_t nmemb)
}
template<class T> T& calloc_or_die()
-{
- return *calloc_or_die<T>(1);
-}
-
+{ return *calloc_or_die<T>(1); }
-void free_it(void* ptr);
+inline void free_it(void* ptr) { if (ptr != NULL) free(ptr); }