From 03f44153cd639a2f196f4a52e6ce0893783e4023 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Fri, 3 Aug 2012 07:45:16 -0400 Subject: [PATCH 1/2] Zero-initialize newed memory in a test --- util/probing_hash_table_test.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/probing_hash_table_test.cc b/util/probing_hash_table_test.cc index 3f9024bdc..37ffeb53b 100644 --- a/util/probing_hash_table_test.cc +++ b/util/probing_hash_table_test.cc @@ -28,9 +28,11 @@ struct Entry { typedef ProbingHashTable > Table; BOOST_AUTO_TEST_CASE(simple) { - boost::scoped_array mem(new char[Table::Size(10, 1.2)]); + size_t size = Table::Size(10, 1.2); + boost::scoped_array mem(new char[size]); + memset(mem.get(), 0, size); - Table table(mem.get(), Table::Size(10, 1.2)); + Table table(mem.get(), size); const Entry *i = NULL; BOOST_CHECK(!table.Find(2, i)); Entry to_ins; From 44c64476ecaca5f2733aa8c1dd2cd628cdc0a7c3 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Fri, 3 Aug 2012 20:19:27 -0400 Subject: [PATCH 2/2] Remove dead --with-giza option --- scripts/Jamfile | 46 +--------------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/scripts/Jamfile b/scripts/Jamfile index 707c4c0c7..7aeede73a 100644 --- a/scripts/Jamfile +++ b/scripts/Jamfile @@ -3,57 +3,13 @@ import option path ; build-project training ; -with-giza = [ option.get "with-giza" ] ; -if $(with-giza) { - rule check-for-bin ( name ) { - if ! [ FILE_OPEN $(with-giza)/$(name) : "r" ] { - echo "Did not find "$(with-giza)/$(name)"." ; - echo "The with-giza directory should contain GIZA++, snt2cooc.out, and mkcls." ; - echo "These are available from http://code.google.com/p/giza-pp/ :" ; - echo " wget https://giza-pp.googlecode.com/files/giza-pp.tgz" ; - echo " tar xzf giza-pp.tgz" ; - echo " cd giza-pp" ; - echo " make" ; - echo " cp GIZA++-v2/{GIZA++,plain2snt.out,snt2cooc.out,snt2plain.out,trainGIZA++.sh} mkcls-v2/mkcls ." ; - exit "Then run bjam --with-giza=/path/to/giza-pp" : 1 ; - } - } - - constant WITH-GIZA : $(with-giza) ; - - check-for-bin GIZA++ ; - check-for-bin snt2cooc.out ; - check-for-bin mkcls ; -} else { - if $(CLEANING) = no { - #echo "If you want scripts/training/train-model.perl, pass --with-giza=/path/to/giza-pp" ; - } - constant WITH-GIZA : "no" ; -} - location = [ option.get "install-scripts" ] ; if $(location) { location = [ path.root $(location) [ path.pwd ] ] ; location = $(location)$(GITTAG) ; - #These two used to live in a tools directory. - #install ghkm : training/phrase-extract/extract-ghkm//extract-ghkm : $(location)/training/phrase-extract/extract-ghkm/tools ; - #install compactify : training/compact-rule-table//compactify : $(location)/training/compact-rule-table/tools ; - - #install phrase-extract : training/phrase-extract//programs : $(location)/training/phrase-extract ; - #install pcfg-extract : training/phrase-extract/pcfg-extract//pcfg-extract : $(location)/training/phrase-extract/pcfg-extract ; - #install pcfg-score : training/phrase-extract/pcfg-score//pcfg-score : $(location)/training/phrase-extract/pcfg-score ; - #install lexical-reordering : training/lexical-reordering//score : $(location)/training/lexical-reordering ; - #install symal : training/symal//symal : $(location)/training/symal ; - - #install biconcor : ems/biconcor//biconcor : $(location)/ems/biconcor ; - - if $(WITH-GIZA) != no { - install train-model : training//train-model.perl : $(location)/training ; - } - install scripts : - [ glob-tree README *.js *.pl *.perl *.pm *.py *.sh *.php : tests regression-testing other bin train_model.perl ] + [ glob-tree README *.js *.pl *.perl *.pm *.py *.sh *.php : tests regression-testing other bin ] [ glob share/nonbreaking_prefixes/* ems/example/*.* ems/example/data/* ems/web/* analysis/smtgui/* : ems/web/javascripts ] generic/fsa-sample.fsa ems/experiment.machines