diff options
author | pixel <pixel> | 2003-11-25 10:20:53 +0000 |
---|---|---|
committer | pixel <pixel> | 2003-11-25 10:20:53 +0000 |
commit | 6741207a4acd174f12bad340be34ca1275a5e6cd (patch) | |
tree | 5d46e91fef69bb079050f5342215f4c1a9552df3 | |
parent | d9b7d14e9332542ae2ba1991849b061b555c1113 (diff) |
Changed the csearch using mmap()
-rw-r--r-- | crypto-search.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto-search.cpp b/crypto-search.cpp index bd6cf4c..164c001 100644 --- a/crypto-search.cpp +++ b/crypto-search.cpp @@ -47,7 +47,8 @@ int startup(void) throw (GeneralException) { str = argv[2]; size = h->GetSize(); - + +#if 0 printm(M_STATUS, "Requesting memory (%i bytes)\n", size); if (!(buffer = (char *) malloc(size))) { @@ -55,10 +56,14 @@ int startup(void) throw (GeneralException) { delete h; exit(-1); } - + printm(M_STATUS, "Loading file...\n"); h->read(buffer, size); - +#else + printm(M_STATUS, "Mapping file\n"); + + buffer = (char *) h->mmap(); +#endif printm(M_STATUS, "Done, initialising the search.\n"); len = strlen(argv[2]); |