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:
authorShravan M Narayanamurthy <shravanm@richbreak-lr.eglbp.corp.yahoo.com>2009-12-11 14:57:31 +0300
committerShravan M Narayanamurthy <shravanm@richbreak-lr.eglbp.corp.yahoo.com>2009-12-11 14:57:31 +0300
commit6dc15b3c49c3d0d337ae0f0a33cd3a97db0381f6 (patch)
tree8287c29474ae6d1ee067c3ba19d4e614f7186b1c /main.cc
parent5e754be6a54af547e2a1389b006c2912dee9eb78 (diff)
Adding support for compression using zlib/gzip
Abstracted all direct access to opening, closing, resetting, flushing, reading & writing files of io_buf into access through a function of io_buf which have all been declared virtual. Now that these accesses have been abstracted out, adding a new type of io_buf, in this case, comp_io_buf, is pretty easy. Just public inherit io_buf and override the default definitions of these virtual functions to work with compressed files. There is a nuance in this because of the current use of multiple files. The 'files' v_array is conveniently typed to int. So in the comp_io_buf, I hold a v_array of gzFiles whose indices are stored in 'files' v_array. Have introduced a new boolean flag compressed into parse_args. The input & output io_bufs in parser are now just pointers that will point to comp_io_buf if the compressed option is chosen. This is the root cause of most of the changes involving parser::input & parser::output. Because of the design of zlib which allows gzread to read from a normal file we can read from a mix of compressed and uncompressed files(cache) without extra logic.
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.cc b/main.cc
index 3419e18f..e1543419 100644
--- a/main.cc
+++ b/main.cc
@@ -29,7 +29,7 @@ int main(int argc, char *argv[]) {
cerr << endl;
}
- free(vars);
+ delete vars;
return 0;
}