Jim Meyering wrote: >>From bed3c7b729b6088adab6eb8e8f587be8a07e0884 Mon Sep 17 00:00:00 2001 > From: Jim Meyering <[email protected]> > Date: Tue, 24 Mar 2009 17:20:40 +0100 > Subject: [PATCH] factor an #ifdef and a little duplication "up" out of a > function > > * exec/coroipcs.c (STACK_SIZE): Define. > (req_setup_recv): Use it, rather than an in-function #ifdef.
Here's a better one. Renamed to IPC_CONSUMER_STACK_SIZE on Steven's request. Changed by me to use "enum" so that the symbol is available in gdb (unlike when using #define). >From 1083e83d9acb69e29c5239147300b796bdd80904 Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Tue, 24 Mar 2009 17:20:40 +0100 Subject: [PATCH] factor an #ifdef and a little duplication "up" out of a function * exec/coroipcs.c (IPC_CONSUMER_STACK_SIZE): Define. (req_setup_recv): Use it, rather than an in-function #ifdef. --- exec/coroipcs.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/exec/coroipcs.c b/exec/coroipcs.c index afdc274..a87bfda 100644 --- a/exec/coroipcs.c +++ b/exec/coroipcs.c @@ -81,6 +81,15 @@ #define MSG_SEND_LOCKED 0 #define MSG_SEND_UNLOCKED 1 +/* + * IA64 needs more stack space then other arches + */ +#ifdef __ia64__ +enum { IPC_CONSUMER_STACK_SIZE = 400000 }; +#else +enum { IPC_CONSUMER_STACK_SIZE = 200000 }; +#endif + static struct coroipcs_init_state *api; DECLARE_LIST_INIT (conn_info_list_head); @@ -1004,14 +1013,8 @@ int coroipcs_handler_dispatch ( api->init_fn_get (conn_info->service) (conn_info); pthread_attr_init (&conn_info->thread_attr); - /* - * IA64 needs more stack space then other arches - */ - #if defined(__ia64__) - pthread_attr_setstacksize (&conn_info->thread_attr, 400000); - #else - pthread_attr_setstacksize (&conn_info->thread_attr, 200000); - #endif + pthread_attr_setstacksize (&conn_info->thread_attr, + IPC_CONSUMER_STACK_SIZE); pthread_attr_setdetachstate (&conn_info->thread_attr, PTHREAD_CREATE_JOINABLE); res = pthread_create (&conn_info->thread, @@ -1088,4 +1091,3 @@ int coroipcs_handler_dispatch ( return (0); } - -- 1.6.2.rc1.285.gc5f54 _______________________________________________ Openais mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/openais
