From 6741207a4acd174f12bad340be34ca1275a5e6cd Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 25 Nov 2003 10:20:53 +0000 Subject: Changed the csearch using mmap() --- crypto-search.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'crypto-search.cpp') 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]); -- cgit v1.2.3