Browse code

Reduce number of calls to cli_realloc for FreeBSD performance

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@435 77e5149b-7576-45b1-b177-96237e5ba77b

Nigel Horne authored on 2004/03/24 18:09:50
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Wed Mar 24 09:19:12 GMT 2004 (njh)
2
+----------------------------------
3
+  * libclamav/blob.c:	Reduce the number of calls to cli_realloc, since realloc
4
+  	seems to be very slow on FreeBSD
5
+
1 6
 Tue Mar 23 15:39:09 GMT 2004 (trog)
2 7
 -----------------------------------
3 8
   * clamd: stop scanning if the client disconnects
... ...
@@ -16,6 +16,9 @@
16 16
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
  *
18 18
  * $Log: blob.c,v $
19
+ * Revision 1.9  2004/03/24 09:08:25  nigelhorne
20
+ * Reduce number of calls to cli_realloc for FreeBSD performance
21
+ *
19 22
  * Revision 1.8  2004/03/23 10:58:52  nigelhorne
20 23
  * More restrictive about which characters can be used in filename on DOS based systems
21 24
  *
... ...
@@ -26,7 +29,7 @@
26 26
  * Change LOG to Log
27 27
  *
28 28
  */
29
-static	char	const	rcsid[] = "$Id: blob.c,v 1.8 2004/03/23 10:58:52 nigelhorne Exp $";
29
+static	char	const	rcsid[] = "$Id: blob.c,v 1.9 2004/03/24 09:08:25 nigelhorne Exp $";
30 30
 
31 31
 #if HAVE_CONFIG_H
32 32
 #include "clamav-config.h"
... ...
@@ -153,7 +156,8 @@ blobAddData(blob *b, const unsigned char *data, size_t len)
153 153
 		b->size = len * 4;
154 154
 		b->data = cli_malloc(b->size);
155 155
 	} else if(b->size < b->len + len) {
156
-		b->size += len * 4;
156
+		/*b->size += len * 4;*/
157
+		b->size += 1024 * 1024;
157 158
 		b->data = cli_realloc(b->data, b->size);
158 159
 	}
159 160