Enlightenment CVS committal Author : tilman Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x Modified Files: ecore_xcb.c ecore_xcb_atom.c ecore_xcb_private.h Log Message: keep the atom init cookie list in a local variables, rather than in global variables. memory usage-- =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_xcb.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore_xcb.c 13 Apr 2007 17:12:09 -0000 1.1 +++ ecore_xcb.c 7 May 2007 18:21:53 -0000 1.2 @@ -182,6 +182,8 @@ const xcb_query_extension_reply_t *reply_xprint; #endif /* ECORE_XCB_XPRINT */ + xcb_intern_atom_cookie_t atom_cookies[ECORE_X_ATOMS_COUNT]; + if (_ecore_xcb_init_count > 0) { _ecore_xcb_init_count++; @@ -205,8 +207,9 @@ * */ + /* We request the atoms (non blocking) */ - _ecore_x_atom_init(); + _ecore_x_atom_init(atom_cookies); /* We prefetch all the extension data (non blocking) */ @@ -277,7 +280,7 @@ */ /* We get the atoms (blocking) */ - _ecore_x_atom_init_finalize(); + _ecore_x_atom_init_finalize(atom_cookies); /* We then ask for the extension data (blocking) */ reply_big_requests = xcb_get_extension_data(_ecore_xcb_conn, &xcb_big_requests_id); =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_xcb_atom.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ecore_xcb_atom.c 7 May 2007 17:57:46 -0000 1.2 +++ ecore_xcb_atom.c 7 May 2007 18:21:53 -0000 1.3 @@ -11,10 +11,6 @@ * Functions that operate on atoms. */ -#define ECORE_X_ATOMS_COUNT 115 -static xcb_intern_atom_cookie_t ecore_xcb_atom_init_cookies[ECORE_X_ATOMS_COUNT]; - - /*********/ /* Atoms */ /*********/ @@ -230,12 +226,11 @@ the second one gets the replies and set the atoms. */ #define FETCH_ATOM(s) \ - ecore_xcb_atom_init_cookies[i] = \ - xcb_intern_atom(_ecore_xcb_conn, 0, sizeof(s), s); \ + atom_cookies[i] = xcb_intern_atom(_ecore_xcb_conn, 0, sizeof(s), s); \ i++ void -_ecore_x_atom_init(void) +_ecore_x_atom_init(xcb_intern_atom_cookie_t *atom_cookies) { int i = 0; @@ -411,7 +406,7 @@ } void -_ecore_x_atom_init_finalize(void) +_ecore_x_atom_init_finalize(xcb_intern_atom_cookie_t *atom_cookies) { xcb_intern_atom_reply_t *replies[ECORE_X_ATOMS_COUNT]; int i; @@ -420,7 +415,7 @@ xcb_generic_error_t *error = NULL; replies[i] = xcb_intern_atom_reply(_ecore_xcb_conn, - ecore_xcb_atom_init_cookies[i], + atom_cookies[i], &error); if (!replies[i]) { printf ("pas de reply %d\n", i); =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_xcb_private.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore_xcb_private.h 13 Apr 2007 17:12:09 -0000 1.1 +++ ecore_xcb_private.h 7 May 2007 18:21:53 -0000 1.2 @@ -227,8 +227,10 @@ extern Ecore_X_Atom ECORE_X_ATOM_E_FRAME_SIZE; extern Ecore_X_Atom ECORE_X_ATOM_WM_SIZE_HINTS; -void _ecore_x_atom_init (void); -void _ecore_x_atom_init_finalize (void); +#define ECORE_X_ATOMS_COUNT 115 + +void _ecore_x_atom_init (xcb_intern_atom_cookie_t *); +void _ecore_x_atom_init_finalize (xcb_intern_atom_cookie_t *); /* damage */ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs