summaryrefslogtreecommitdiff
path: root/crypto-search.cpp
diff options
context:
space:
mode:
authorpixel <pixel>2003-11-25 10:20:53 +0000
committerpixel <pixel>2003-11-25 10:20:53 +0000
commit6741207a4acd174f12bad340be34ca1275a5e6cd (patch)
tree5d46e91fef69bb079050f5342215f4c1a9552df3 /crypto-search.cpp
parentd9b7d14e9332542ae2ba1991849b061b555c1113 (diff)
Changed the csearch using mmap()
Diffstat (limited to 'crypto-search.cpp')
-rw-r--r--crypto-search.cpp11
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]);