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:
authorJohn Langford <jl@hunch.net>2015-01-02 23:00:54 +0300
committerJohn Langford <jl@hunch.net>2015-01-02 23:00:54 +0300
commit20ebde98f2248511dce1791a8cff719271fbeff1 (patch)
tree79a9fc59ca8cde2cc91a19c7d544da4fe88ee71f
parentabf03c9736bb6e221ecc03b662926d69a2f07722 (diff)
remove memory.cc
-rw-r--r--Makefile.am1
-rw-r--r--vowpalwabbit/Makefile.am2
-rw-r--r--vowpalwabbit/memory.cc8
-rw-r--r--vowpalwabbit/memory.h8
4 files changed, 3 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am
index 8bc91364..abb79bb2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,6 @@ noinst_HEADERS = vowpalwabbit/accumulate.h \
vowpalwabbit/lda_core.h \
vowpalwabbit/log_multi.h \
vowpalwabbit/lrq.h \
- vowpalwabbit/memory.h \
vowpalwabbit/mf.h \
vowpalwabbit/multiclass.h \
vowpalwabbit/network.h \
diff --git a/vowpalwabbit/Makefile.am b/vowpalwabbit/Makefile.am
index 676d6f4e..291a4702 100644
--- a/vowpalwabbit/Makefile.am
+++ b/vowpalwabbit/Makefile.am
@@ -4,7 +4,7 @@ liballreduce_la_SOURCES = allreduce.cc
bin_PROGRAMS = vw active_interactor
-libvw_la_SOURCES = hash.cc memory.cc global_data.cc io_buf.cc parse_regressor.cc parse_primitives.cc unique_sort.cc cache.cc rand48.cc simple_label.cc multiclass.cc oaa.cc ect.cc autolink.cc binary.cc lrq.cc cost_sensitive.cc csoaa.cc cb.cc cb_algs.cc search.cc search_sequencetask.cc search_dep_parser.cc search_hooktask.cc search_multiclasstask.cc search_entityrelationtask.cc parse_example.cc scorer.cc network.cc parse_args.cc accumulate.cc gd.cc learner.cc lda_core.cc gd_mf.cc mf.cc bfgs.cc noop.cc print.cc example.cc parser.cc loss_functions.cc sender.cc nn.cc bs.cc cbify.cc topk.cc stagewise_poly.cc log_multi.cc active.cc kernel_svm.cc best_constant.cc ftrl_proximal.cc
+libvw_la_SOURCES = hash.cc global_data.cc io_buf.cc parse_regressor.cc parse_primitives.cc unique_sort.cc cache.cc rand48.cc simple_label.cc multiclass.cc oaa.cc ect.cc autolink.cc binary.cc lrq.cc cost_sensitive.cc csoaa.cc cb.cc cb_algs.cc search.cc search_sequencetask.cc search_dep_parser.cc search_hooktask.cc search_multiclasstask.cc search_entityrelationtask.cc parse_example.cc scorer.cc network.cc parse_args.cc accumulate.cc gd.cc learner.cc lda_core.cc gd_mf.cc mf.cc bfgs.cc noop.cc print.cc example.cc parser.cc loss_functions.cc sender.cc nn.cc bs.cc cbify.cc topk.cc stagewise_poly.cc log_multi.cc active.cc kernel_svm.cc best_constant.cc ftrl_proximal.cc
libvw_c_wrapper_la_SOURCES = vwdll.cpp
diff --git a/vowpalwabbit/memory.cc b/vowpalwabbit/memory.cc
deleted file mode 100644
index 7e40bf71..00000000
--- a/vowpalwabbit/memory.cc
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdlib.h>
-
-void free_it(void* ptr)
-{
- if (ptr != NULL)
- free(ptr);
-}
-
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); }