Subject: winex/server process.c,1.40,1.41 process.h,1.16,1.17 protocol.def,1.40,1.41 registry.c,1.12,1.13 trace.c,1.41,1.42Update of /var/lib/cvsd/cvsroot/winex/server
In directory agravaine:/tmp/cvs-serv6814/server
Modified Files:
process.c process.h protocol.def registry.c trace.c
Log Message:
- add a new memory allocator based on ptmalloc3 and make it the default (at least for now for testing)
- to disable, add "NewAllocator"="N" to the [Wine] section of your config file
Index: process.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/server/process.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- process.c 30 Mar 2007 15:55:03 -0000 1.40
+++ process.c 30 Mar 2007 18:58:49 -0000 1.41
@@ -352,6 +352,8 @@
SERVER_GLOBAL_VARIABLE (server_start_time.tv_sec);
reply->server_start_usec =
SERVER_GLOBAL_VARIABLE (server_start_time.tv_usec);
+
+ reply->use_new_allocator = reg_check_allocator ();
}
/* destroy a process when its refcount is 0 */
Index: process.h
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/server/process.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- process.h 30 Mar 2007 15:55:03 -0000 1.16
+++ process.h 30 Mar 2007 18:58:50 -0000 1.17
@@ -121,6 +121,8 @@
extern struct process *get_process_from_id( const process_id_t id );
extern void remove_process_id ( const process_id_t process_id );
+extern int reg_check_allocator ();
+
extern void read_process_memory( struct process *process, uintptr_t addr,
size_t len, void *dest, size_t check_len );
extern void write_process_memory( struct process *process, uintptr_t addr,
Index: protocol.def
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/server/protocol.def,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- protocol.def 30 Mar 2007 15:55:03 -0000 1.40
+++ protocol.def 30 Mar 2007 18:58:50 -0000 1.41
@@ -231,6 +231,7 @@
int cmd_show; /* main window show mode */
pid_t wineserver_pid; /* Apple: pid of wineserver to identify port */
int unique_msg_id; /* Apple: unique id to send with port */
+ int use_new_allocator; /* true if we're to use the new allocator */
VARARG(filename,string); /* file name of main exe */
@END
Index: registry.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/server/registry.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- registry.c 27 Mar 2007 20:25:27 -0000 1.12
+++ registry.c 30 Mar 2007 18:58:50 -0000 1.13
@@ -1627,6 +1627,50 @@
}
}
+
+/* Return true if config file states to use the new allocator, false otherwise.
+ This is needed as main process can't use registry functions until *after*
+ the heap has been initialized */
+int reg_check_allocator ()
+{
+ static WCHAR allocator_key[256] =
+ { 'S','o','f','t','w','a','r','e','\\',
+ 'W','i','n','e','\\','W','i','n','e','\\','C','o','n','f','i','g',
+ '\\', 'W' , 'i', 'n', 'e', 0 };
+ static const WCHAR allocator_name[] =
+ { 'N', 'e', 'w', 'A', 'l', 'l', 'o', 'c', 'a', 't', 'o', 'r', 0};
+ struct key *key = 0, *parent;
+ int ret = 1;
+ unsigned int old_err = get_error ();
+ WCHAR *name;
+
+ parent = get_hkey_obj (HKEY_LOCAL_MACHINE, 0);
+ name = copy_path (allocator_key, sizeof (allocator_key),
+ !HKEY_LOCAL_MACHINE);
+ if (parent && (key = open_key (parent, name)))
+ {
+ struct key_value *value;
+ int index;
+
+ value = find_value (key, allocator_name, &index);
+ if (value && value->data)
+ {
+ WCHAR Val = ((WCHAR *)value->data)[0];
+ if ((Val != 'y') && (Val != 'Y'))
+ ret = 0;
+ }
+ }
+
+ if (key)
+ release_object (key);
+ if (parent)
+ release_object (parent);
+
+ set_error (old_err);
+ return ret;
+}
+
+
/* open a registry key */
DECL_HANDLER(open_key)
{
Index: trace.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/server/trace.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- trace.c 30 Mar 2007 15:55:03 -0000 1.41
+++ trace.c 30 Mar 2007 18:58:50 -0000 1.42
@@ -376,6 +376,7 @@
fprintf( stderr, " cmd_show=%d,", req->cmd_show );
fprintf( stderr, " wineserver_pid=%d,", req->wineserver_pid );
fprintf( stderr, " unique_msg_id=%d,", req->unique_msg_id );
+ fprintf( stderr, " use_new_allocator=%d,", req->use_new_allocator );
fprintf( stderr, " filename=" );
dump_varargs_string( cur_size );
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.