mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-01 11:36:51 +02:00
define PCRE_STATIC to reflect the inclusion of pcre as LIB, not
2007-03-17 Hans Breuer <hans@breuer.org> * glib/makefile.msc.in glib/pcre/makefile.msc glib/update-pcre/update.sh : define PCRE_STATIC to reflect the inclusion of pcre as LIB, not stand-alone DLL. Also set NEWLINE=-1 to match any newline by default, use of ../../build/win32/make.msc * glib/gregex.h : minimal includes of <glib/*.H> instead of <glib.h> * glib/gnulib/makefile.msc : make use of ../../build/win32/make.msc * tests/regex-test.c(verbose): don't pass a string containing '%' as first parameter to g_print () (test_match) : for the unexpected case output pattern and string escaped * tests/child-test.c tests/slice-color.c : fix c99ism * tests/slice-test.c : fix c99ism and gccism * tests/mapping-test.c tests/base-64-tests.c : don't #include <unistd.h> unconditionally * tests/option-test.c : use G_GINT64_CONSTANT() instead of direct LL * tests/makefile.msc.in : more tests build svn path=/trunk/; revision=5423
This commit is contained in:
parent
45b2988d05
commit
770b29bad2
25
ChangeLog
25
ChangeLog
@ -1,3 +1,27 @@
|
|||||||
|
2007-03-17 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/makefile.msc.in glib/pcre/makefile.msc
|
||||||
|
glib/update-pcre/update.sh : define PCRE_STATIC to reflect the
|
||||||
|
inclusion of pcre as LIB, not stand-alone DLL. Also set NEWLINE=-1
|
||||||
|
to match any newline by default, use of ../../build/win32/make.msc
|
||||||
|
|
||||||
|
* glib/gregex.h : minimal includes of <glib/*.H> instead of <glib.h>
|
||||||
|
|
||||||
|
* glib/gnulib/makefile.msc : make use of ../../build/win32/make.msc
|
||||||
|
|
||||||
|
* tests/regex-test.c(verbose): don't pass a string containing '%'
|
||||||
|
as first parameter to g_print ()
|
||||||
|
(test_match) : for the unexpected case output pattern and string
|
||||||
|
escaped
|
||||||
|
|
||||||
|
* tests/child-test.c tests/slice-color.c : fix c99ism
|
||||||
|
* tests/slice-test.c : fix c99ism and gccism
|
||||||
|
* tests/mapping-test.c tests/base-64-tests.c : don't
|
||||||
|
#include <unistd.h> unconditionally
|
||||||
|
* tests/option-test.c : use G_GINT64_CONSTANT() instead of direct LL
|
||||||
|
|
||||||
|
* tests/makefile.msc.in : more tests build
|
||||||
|
|
||||||
2007-03-17 Matthias Clasen <mclasen@redhat.com>
|
2007-03-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gsequence.[hc]:
|
* glib/gsequence.[hc]:
|
||||||
@ -42,6 +66,7 @@ Fri Mar 16 11:24:51 2007 Tim Janik <timj@imendio.com>
|
|||||||
* glib/gscanner.c (g_scanner_get_token_ll): Fix a typo
|
* glib/gscanner.c (g_scanner_get_token_ll): Fix a typo
|
||||||
in the last commit. (#415323, Richard Hult)
|
in the last commit. (#415323, Richard Hult)
|
||||||
|
|
||||||
|
>>>>>>> .r5422
|
||||||
2007-03-15 Tor Lillqvist <tml@novell.com>
|
2007-03-15 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/gnulib/Makefile.am (INCLUDES): Add -I$(top_srcdir)/glib so
|
* glib/gnulib/Makefile.am (INCLUDES): Add -I$(top_srcdir)/glib so
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
!IFDEF DEBUG
|
TOP = ..\..\..
|
||||||
CRT=-MDd
|
!INCLUDE ..\..\build\win32\make.msc
|
||||||
!ELSE
|
|
||||||
CRT=-MD
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
CFLAGS = -I ..\.. -DHAVE_CONFIG_H -DHAVE_LONG_LONG_FORMAT
|
INCLUDES = -I ..\..
|
||||||
|
DEFINES = -DHAVE_CONFIG_H -DHAVE_LONG_LONG_FORMAT
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
asnprintf.obj \
|
asnprintf.obj \
|
||||||
@ -13,8 +11,8 @@ OBJECTS = \
|
|||||||
printf-parse.obj \
|
printf-parse.obj \
|
||||||
vasnprintf.obj
|
vasnprintf.obj
|
||||||
|
|
||||||
|
all : gnulib.lib
|
||||||
|
|
||||||
gnulib.lib : $(OBJECTS)
|
gnulib.lib : $(OBJECTS)
|
||||||
lib -out:gnulib.lib $(OBJECTS)
|
lib -out:gnulib.lib $(OBJECTS)
|
||||||
|
|
||||||
.c.obj:
|
|
||||||
$(CC) $(CRT) $(CFLAGS) -Ox -GD -c $<
|
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
#ifndef __G_REGEX_H__
|
#ifndef __G_REGEX_H__
|
||||||
#define __G_REGEX_H__
|
#define __G_REGEX_H__
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib/gerror.h>
|
||||||
|
#include <glib/gstring.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ TOP = ..\..
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
INCLUDES = -FImsvc_recommended_pragmas.h -I . -I ..
|
INCLUDES = -FImsvc_recommended_pragmas.h -I . -I ..
|
||||||
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=\"GLib\" -DG_ENABLE_DEBUG
|
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=\"GLib\" -DG_ENABLE_DEBUG -DPCRE_STATIC
|
||||||
DEPCFLAGS = -Zm400 $(INTL_CFLAGS) $(LIBICONV_CFLAGS) $(DIRENT_CFLAGS)
|
DEPCFLAGS = -Zm400 $(INTL_CFLAGS) $(LIBICONV_CFLAGS) $(DIRENT_CFLAGS)
|
||||||
|
|
||||||
all : \
|
all : \
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
!IFDEF DEBUG
|
TOP = ..\..\..
|
||||||
CRT=-MDd
|
!INCLUDE ..\..\build\win32\make.msc
|
||||||
!ELSE
|
|
||||||
CRT=-MD
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
CFLAGS = \
|
INCLUDES = \
|
||||||
-I ..\.. \
|
-I ..\.. \
|
||||||
|
-I ..
|
||||||
|
|
||||||
|
DEFINES = \
|
||||||
|
-DPCRE_STATIC \
|
||||||
-DHAVE_CONFIG_H \
|
-DHAVE_CONFIG_H \
|
||||||
-DHAVE_LONG_LONG_FORMAT \
|
-DHAVE_LONG_LONG_FORMAT \
|
||||||
-DSUPPORT_UCP \
|
-DSUPPORT_UCP \
|
||||||
-DSUPPORT_UTF8 \
|
-DSUPPORT_UTF8 \
|
||||||
-DNEWLINE=10 \
|
-DNEWLINE=-1 \
|
||||||
-DMATCH_LIMIT=10000000 \
|
-DMATCH_LIMIT=10000000 \
|
||||||
-DMATCH_LIMIT_RECURSION=10000000 \
|
-DMATCH_LIMIT_RECURSION=10000000 \
|
||||||
-DMAX_NAME_SIZE=32 \
|
-DMAX_NAME_SIZE=32 \
|
||||||
@ -42,8 +43,7 @@ OBJECTS = \
|
|||||||
pcre_version.obj \
|
pcre_version.obj \
|
||||||
pcre_xclass.obj \
|
pcre_xclass.obj \
|
||||||
|
|
||||||
|
all : pcre.lib
|
||||||
|
|
||||||
pcre.lib : $(OBJECTS)
|
pcre.lib : $(OBJECTS)
|
||||||
lib -out:pcre.lib $(OBJECTS)
|
lib -out:pcre.lib $(OBJECTS)
|
||||||
|
|
||||||
.c.obj:
|
|
||||||
$(CC) $(CRT) $(CFLAGS) -Ox -GD -c $<
|
|
||||||
|
@ -84,19 +84,20 @@ cat $IN/Makefile.am-2 >> Makefile.am
|
|||||||
|
|
||||||
# Generate makefile.msc
|
# Generate makefile.msc
|
||||||
cat > makefile.msc << EOF
|
cat > makefile.msc << EOF
|
||||||
!IFDEF DEBUG
|
TOP = ..\..\..
|
||||||
CRT=-MDd
|
!INCLUDE ..\..\build\win32\make.msc
|
||||||
!ELSE
|
|
||||||
CRT=-MD
|
|
||||||
!ENDIF
|
|
||||||
|
|
||||||
CFLAGS = \\
|
INCLUDES = \\
|
||||||
-I ..\\.. \\
|
-I ..\.. \\
|
||||||
|
-I ..
|
||||||
|
|
||||||
|
DEFINES = \\
|
||||||
|
-DPCRE_STATIC \\
|
||||||
-DHAVE_CONFIG_H \\
|
-DHAVE_CONFIG_H \\
|
||||||
-DHAVE_LONG_LONG_FORMAT \\
|
-DHAVE_LONG_LONG_FORMAT \\
|
||||||
-DSUPPORT_UCP \\
|
-DSUPPORT_UCP \\
|
||||||
-DSUPPORT_UTF8 \\
|
-DSUPPORT_UTF8 \\
|
||||||
-DNEWLINE=10 \\
|
-DNEWLINE=-1 \\
|
||||||
-DMATCH_LIMIT=10000000 \\
|
-DMATCH_LIMIT=10000000 \\
|
||||||
-DMATCH_LIMIT_RECURSION=10000000 \\
|
-DMATCH_LIMIT_RECURSION=10000000 \\
|
||||||
-DMAX_NAME_SIZE=32 \\
|
-DMAX_NAME_SIZE=32 \\
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define DATA_SIZE 1024
|
#define DATA_SIZE 1024
|
||||||
|
@ -146,6 +146,9 @@ test_thread (gpointer data)
|
|||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#ifndef TEST_THREAD
|
||||||
|
GPid pid;
|
||||||
|
#endif
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
argv0 = argv[0];
|
argv0 = argv[0];
|
||||||
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'c')
|
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'c')
|
||||||
@ -166,8 +169,6 @@ main (int argc, char *argv[])
|
|||||||
#if defined(G_THREADS_ENABLED) && ! defined(G_THREADS_IMPL_NONE)
|
#if defined(G_THREADS_ENABLED) && ! defined(G_THREADS_IMPL_NONE)
|
||||||
#ifdef TEST_THREAD
|
#ifdef TEST_THREAD
|
||||||
g_thread_init (NULL);
|
g_thread_init (NULL);
|
||||||
#else
|
|
||||||
GPid pid;
|
|
||||||
#endif
|
#endif
|
||||||
main_loop = g_main_loop_new (NULL, FALSE);
|
main_loop = g_main_loop_new (NULL, FALSE);
|
||||||
|
|
||||||
|
@ -8,32 +8,54 @@ TOP = ..\..
|
|||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
INCLUDES = -FImsvc_recommended_pragmas.h -I .. -I ..\glib -I ..\gmodule
|
INCLUDES = -FImsvc_recommended_pragmas.h -I .. -I ..\glib -I ..\gmodule
|
||||||
DEFINES = -DHAVE_CONFIG_H
|
DEFINES = -DHAVE_CONFIG_H -DENABLE_REGEX
|
||||||
|
|
||||||
NONAUTOMATIC_TESTS = \
|
NONAUTOMATIC_TESTS = \
|
||||||
testglib.exe \
|
testglib.exe \
|
||||||
testgdate.exe \
|
testgdate.exe \
|
||||||
testgdateparser.exe \
|
testgdateparser.exe \
|
||||||
patterntest.exe \
|
|
||||||
unicode-normalize.exe \
|
unicode-normalize.exe \
|
||||||
unicode-collate.exe
|
unicode-collate.exe
|
||||||
|
|
||||||
TESTS = \
|
TESTS = \
|
||||||
|
atomic-test.exe \
|
||||||
array-test.exe \
|
array-test.exe \
|
||||||
|
asyncqueue-test.exe \
|
||||||
|
base64-test.exe \
|
||||||
|
bit-test.exe \
|
||||||
|
bookmarkfile-test.exe \
|
||||||
|
child-test.exe \
|
||||||
|
completion-test.exe \
|
||||||
|
convert-test.exe \
|
||||||
date-test.exe \
|
date-test.exe \
|
||||||
dirname-test.exe \
|
dirname-test.exe \
|
||||||
|
env-test.exe \
|
||||||
|
errorcheck-mutex-test.exe \
|
||||||
|
file-test.exe \
|
||||||
gio-test.exe \
|
gio-test.exe \
|
||||||
iochannel-test.exe \
|
iochannel-test.exe \
|
||||||
hash-test.exe \
|
hash-test.exe \
|
||||||
|
keyfile-test.exe \
|
||||||
list-test.exe \
|
list-test.exe \
|
||||||
mainloop-test.exe \
|
mainloop-test.exe \
|
||||||
|
mapping-test.exe \
|
||||||
|
markup-escape-test.exe \
|
||||||
markup-test.exe \
|
markup-test.exe \
|
||||||
|
#main? memchunks.exe \
|
||||||
module-test.exe \
|
module-test.exe \
|
||||||
node-test.exe \
|
node-test.exe \
|
||||||
|
option-test.exe \
|
||||||
|
patterntest.exe \
|
||||||
|
printf-test.exe \
|
||||||
queue-test.exe \
|
queue-test.exe \
|
||||||
|
qsort-test.exe \
|
||||||
rand-test.exe \
|
rand-test.exe \
|
||||||
|
regex-test.exe \
|
||||||
relation-test.exe \
|
relation-test.exe \
|
||||||
|
#_? sequence-test.exe \
|
||||||
shell-test.exe \
|
shell-test.exe \
|
||||||
|
slice-color.exe \
|
||||||
|
slice-test.exe \
|
||||||
slist-test.exe \
|
slist-test.exe \
|
||||||
spawn-test.exe \
|
spawn-test.exe \
|
||||||
# strfunc-test doesn't compile with MSVC
|
# strfunc-test doesn't compile with MSVC
|
||||||
@ -47,7 +69,9 @@ TESTS = \
|
|||||||
type-test.exe \
|
type-test.exe \
|
||||||
unicode-caseconv.exe \
|
unicode-caseconv.exe \
|
||||||
unicode-encoding.exe \
|
unicode-encoding.exe \
|
||||||
uri-test.exe
|
utf8-validate.exe \
|
||||||
|
utf8-pointer.exe \
|
||||||
|
uri-test.exe \
|
||||||
|
|
||||||
DLLS = \
|
DLLS = \
|
||||||
libmoduletestplugin_a.dll \
|
libmoduletestplugin_a.dll \
|
||||||
@ -59,6 +83,10 @@ all : $(TESTS) $(NONAUTOMATIC_TESTS) $(DLLS)
|
|||||||
$(CC) $(CFLAGS) -c $<
|
$(CC) $(CFLAGS) -c $<
|
||||||
$(CC) $(CFLAGS) -Fe$@ $< ..\glib\glib-2.0.lib ..\gmodule\gmodule-2.0.lib ..\gthread\gthread-2.0.lib $(LDFLAGS) user32.lib /subsystem:console
|
$(CC) $(CFLAGS) -Fe$@ $< ..\glib\glib-2.0.lib ..\gmodule\gmodule-2.0.lib ..\gthread\gthread-2.0.lib $(LDFLAGS) user32.lib /subsystem:console
|
||||||
|
|
||||||
|
slice-test.exe : memchunks.obj slice-test.obj
|
||||||
|
$(CC) $(CFLAGS) -Fe$@ memchunks.obj slice-test.obj \
|
||||||
|
..\glib\glib-2.0.lib ..\gmodule\gmodule-2.0.lib ..\gthread\gthread-2.0.lib $(LDFLAGS) user32.lib /subsystem:console
|
||||||
|
|
||||||
libmoduletestplugin_a.dll : libmoduletestplugin_a.obj
|
libmoduletestplugin_a.dll : libmoduletestplugin_a.obj
|
||||||
$(CC) $(CFLAGS) -LD libmoduletestplugin_a.obj ..\gmodule\gmodule-2.0.lib ..\glib\glib-2.0.lib $(LDFLAGS)
|
$(CC) $(CFLAGS) -LD libmoduletestplugin_a.obj ..\gmodule\gmodule-2.0.lib ..\glib\glib-2.0.lib $(LDFLAGS)
|
||||||
|
|
||||||
|
@ -16,10 +16,13 @@
|
|||||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
|
@ -432,8 +432,8 @@ arg_test6 (void)
|
|||||||
g_assert (retval);
|
g_assert (retval);
|
||||||
|
|
||||||
/* Last arg specified is the one that should be stored */
|
/* Last arg specified is the one that should be stored */
|
||||||
g_assert (arg_test6_int64 == 4294967296LL);
|
g_assert (arg_test6_int64 == G_GINT64_CONSTANT(4294967296));
|
||||||
g_assert (arg_test6_int64_2 == 0xfffffffffLL);
|
g_assert (arg_test6_int64_2 == G_GINT64_CONSTANT(0xfffffffff));
|
||||||
|
|
||||||
g_strfreev (argv);
|
g_strfreev (argv);
|
||||||
g_option_context_free (context);
|
g_option_context_free (context);
|
||||||
|
@ -87,7 +87,7 @@ verbose (const gchar *format, ...)
|
|||||||
va_end (args);
|
va_end (args);
|
||||||
|
|
||||||
if (noisy)
|
if (noisy)
|
||||||
g_print (msg);
|
g_print ("%s", msg);
|
||||||
g_free (msg);
|
g_free (msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,7 +275,11 @@ test_match (const gchar *pattern,
|
|||||||
start_position, match_opts2, NULL);
|
start_position, match_opts2, NULL);
|
||||||
if (match != expected)
|
if (match != expected)
|
||||||
{
|
{
|
||||||
g_print ("failed \t(unexpected %s)\n", match ? "match" : "mismatch");
|
gchar *e1 = g_strescape (pattern, NULL);
|
||||||
|
gchar *e2 = g_strescape (string, NULL);
|
||||||
|
g_print ("failed \t(unexpected %s) '%s' against '%s'\n", match ? "match" : "mismatch", e1, e2);
|
||||||
|
g_free (e1);
|
||||||
|
g_free (e2);
|
||||||
g_regex_free (regex);
|
g_regex_free (regex);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -60,17 +60,20 @@ touch_mem (guint64 block_size,
|
|||||||
guint64 repeats)
|
guint64 repeats)
|
||||||
{
|
{
|
||||||
guint64 j, accu, n = n_blocks;
|
guint64 j, accu, n = n_blocks;
|
||||||
|
GTimer *timer;
|
||||||
|
guint **memc;
|
||||||
|
guint **memb;
|
||||||
guint **mema = g_new (guint*, n);
|
guint **mema = g_new (guint*, n);
|
||||||
for (j = 0; j < n; j++)
|
for (j = 0; j < n; j++)
|
||||||
mema[j] = g_slice_alloc (block_size);
|
mema[j] = g_slice_alloc (block_size);
|
||||||
guint **memb = g_new (guint*, n);
|
memb = g_new (guint*, n);
|
||||||
for (j = 0; j < n; j++)
|
for (j = 0; j < n; j++)
|
||||||
memb[j] = g_slice_alloc (block_size);
|
memb[j] = g_slice_alloc (block_size);
|
||||||
guint **memc = g_new (guint*, n);
|
memc = g_new (guint*, n);
|
||||||
for (j = 0; j < n; j++)
|
for (j = 0; j < n; j++)
|
||||||
memc[j] = g_slice_alloc (block_size);
|
memc[j] = g_slice_alloc (block_size);
|
||||||
|
|
||||||
GTimer *timer = g_timer_new();
|
timer = g_timer_new();
|
||||||
fill_memory (mema, n, 2);
|
fill_memory (mema, n, 2);
|
||||||
fill_memory (memb, n, 3);
|
fill_memory (memb, n, 3);
|
||||||
fill_memory (memc, n, 4);
|
fill_memory (memc, n, 4);
|
||||||
@ -148,6 +151,9 @@ parse_memsize (const gchar *cstring)
|
|||||||
gchar *string = g_strstrip (mem);
|
gchar *string = g_strstrip (mem);
|
||||||
guint l = strlen (string);
|
guint l = strlen (string);
|
||||||
gdouble f = 0;
|
gdouble f = 0;
|
||||||
|
gchar *derr = NULL;
|
||||||
|
gdouble msize;
|
||||||
|
|
||||||
switch (l ? string[l - 1] : 0)
|
switch (l ? string[l - 1] : 0)
|
||||||
{
|
{
|
||||||
case 'k': f = 1000; break;
|
case 'k': f = 1000; break;
|
||||||
@ -159,8 +165,7 @@ parse_memsize (const gchar *cstring)
|
|||||||
}
|
}
|
||||||
if (f)
|
if (f)
|
||||||
string[l - 1] = 0;
|
string[l - 1] = 0;
|
||||||
gchar *derr = NULL;
|
msize = g_ascii_strtod (string, &derr);
|
||||||
gdouble msize = g_ascii_strtod (string, &derr);
|
|
||||||
g_free (mem);
|
g_free (mem);
|
||||||
if (derr && *derr)
|
if (derr && *derr)
|
||||||
{
|
{
|
||||||
|
@ -148,6 +148,10 @@ static gpointer
|
|||||||
test_sliced_mem_thread (gpointer data)
|
test_sliced_mem_thread (gpointer data)
|
||||||
{
|
{
|
||||||
guint32 rand_accu = 2147483563;
|
guint32 rand_accu = 2147483563;
|
||||||
|
guint i, j;
|
||||||
|
guint8 **ps;
|
||||||
|
guint *ss;
|
||||||
|
|
||||||
/* initialize random numbers */
|
/* initialize random numbers */
|
||||||
if (data)
|
if (data)
|
||||||
rand_accu = *(guint32*) data;
|
rand_accu = *(guint32*) data;
|
||||||
@ -158,9 +162,8 @@ test_sliced_mem_thread (gpointer data)
|
|||||||
rand_accu = rand_tv.tv_usec + (rand_tv.tv_sec << 16);
|
rand_accu = rand_tv.tv_usec + (rand_tv.tv_sec << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
guint i, j;
|
ps = g_new (guint8*, number_of_blocks);
|
||||||
guint8 **ps = g_new (guint8*, number_of_blocks);
|
ss = g_new (guint, number_of_blocks);
|
||||||
guint *ss = g_new (guint, number_of_blocks);
|
|
||||||
/* create number_of_blocks random sizes */
|
/* create number_of_blocks random sizes */
|
||||||
for (i = 0; i < number_of_blocks; i++)
|
for (i = 0; i < number_of_blocks; i++)
|
||||||
ss[i] = quick_rand32() % prime_size;
|
ss[i] = quick_rand32() % prime_size;
|
||||||
@ -267,13 +270,16 @@ main (int argc,
|
|||||||
if (argc <= 1)
|
if (argc <= 1)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
|
{
|
||||||
gchar strseed[64] = "<random>";
|
gchar strseed[64] = "<random>";
|
||||||
|
GThread **threads;
|
||||||
|
guint i;
|
||||||
|
|
||||||
if (seedp)
|
if (seedp)
|
||||||
g_snprintf (strseed, 64, "%u", *seedp);
|
g_snprintf (strseed, 64, "%u", *seedp);
|
||||||
g_print ("Starting %d threads allocating random blocks <= %u bytes with seed=%s using %s%s\n", n_threads, prime_size, strseed, mode, emode);
|
g_print ("Starting %d threads allocating random blocks <= %u bytes with seed=%s using %s%s\n", n_threads, prime_size, strseed, mode, emode);
|
||||||
|
|
||||||
GThread *threads[n_threads];
|
threads = g_alloca (sizeof(GThread*) * n_threads);
|
||||||
guint i;
|
|
||||||
if (!use_memchunks)
|
if (!use_memchunks)
|
||||||
for (i = 0; i < n_threads; i++)
|
for (i = 0; i < n_threads; i++)
|
||||||
threads[i] = g_thread_create_full (test_sliced_mem_thread, seedp, 0, TRUE, FALSE, 0, NULL);
|
threads[i] = g_thread_create_full (test_sliced_mem_thread, seedp, 0, TRUE, FALSE, 0, NULL);
|
||||||
@ -301,3 +307,4 @@ main (int argc,
|
|||||||
g_print ("Done.\n");
|
g_print ("Done.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user