From 696c19178d924f4e8ce0e76eda7488892351df8e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 May 2008 22:49:18 +0000 Subject: *** empty log message *** --- Changes | 5 +++++ bench.c | 20 +++++++++++++++++--- lzf_c.c | 4 ++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 86c7311..af394fb 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ + + - include a workaround for a compiler bug on 64 bit windows + (microsoft claims to support POSIX, but is far from it). + (analysed nicely by John Lilley). + 3.1 Fri Nov 30 11:33:04 CET 2007 - IMPORTANT BUGFIX: a too long final literal run would corrupt data in the encoder (this was introduced in 3.0 only, earlier versions diff --git a/bench.c b/bench.c index 8b3d700..85bd8cd 100644 --- a/bench.c +++ b/bench.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "lzf.h" @@ -32,6 +33,12 @@ extern inline tval measure(tval t) return t-tsc; } +static void sigu (int signum) +{ +} + +int eventfd(unsigned int,int); + #define DSIZE 2821120 unsigned char data[DSIZE], data2[DSIZE*2], data3[DSIZE*2]; @@ -45,6 +52,8 @@ int main(void) int lp; char buf[8192]; int p[2]; + int evfd = eventfd (0, 0); + long ctr = 1; pipe (p); @@ -52,12 +61,17 @@ int main(void) fread (data, DSIZE, 1, f); fclose (f); + signal (SIGURG, sigu); + for (lp = 0; lp < 100000; lp++) { s=stamp(); - kill (0, 23); -// write (p[1], &p, 1); -// read (p[1], &i, 4); + snprintf (buf, 64, "<1.%llx>", (unsigned long long)0xa234567812ULL); + //kill (0, SIGURG); + //write (evfd, &ctr, 8); + //read (evfd, &ctr, 8); +// write (p[1], &buf, 1); +// read (p[0], &buf, 4); si[0]=measure(s); diff --git a/lzf_c.c b/lzf_c.c index 2120cbf..268313a 100644 --- a/lzf_c.c +++ b/lzf_c.c @@ -114,7 +114,11 @@ lzf_compress (const void *const in_data, unsigned int in_len, const u8 *ref; unsigned int hval; +#if WIN32 + unsigned _int64 off; /* workaround for microsoft bug (they claim to support POSIX) */ +#else unsigned long off; +#endif int lit; if (!in_len || !out_len) -- cgit v1.2.3