forked from enlightenment/efl
keep the atom init cookie list in a local variables, rather than in global variables. memory usage--
SVN revision: 29910
This commit is contained in:
parent
ee0000f75f
commit
d5c7189898
|
@ -182,6 +182,8 @@ ecore_x_init(const char *name)
|
||||||
const xcb_query_extension_reply_t *reply_xprint;
|
const xcb_query_extension_reply_t *reply_xprint;
|
||||||
#endif /* ECORE_XCB_XPRINT */
|
#endif /* ECORE_XCB_XPRINT */
|
||||||
|
|
||||||
|
xcb_intern_atom_cookie_t atom_cookies[ECORE_X_ATOMS_COUNT];
|
||||||
|
|
||||||
if (_ecore_xcb_init_count > 0)
|
if (_ecore_xcb_init_count > 0)
|
||||||
{
|
{
|
||||||
_ecore_xcb_init_count++;
|
_ecore_xcb_init_count++;
|
||||||
|
@ -205,8 +207,9 @@ ecore_x_init(const char *name)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* We request the atoms (non blocking) */
|
/* We request the atoms (non blocking) */
|
||||||
_ecore_x_atom_init();
|
_ecore_x_atom_init(atom_cookies);
|
||||||
|
|
||||||
/* We prefetch all the extension data (non blocking) */
|
/* We prefetch all the extension data (non blocking) */
|
||||||
|
|
||||||
|
@ -277,7 +280,7 @@ ecore_x_init(const char *name)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* We get the atoms (blocking) */
|
/* 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) */
|
/* We then ask for the extension data (blocking) */
|
||||||
reply_big_requests = xcb_get_extension_data(_ecore_xcb_conn, &xcb_big_requests_id);
|
reply_big_requests = xcb_get_extension_data(_ecore_xcb_conn, &xcb_big_requests_id);
|
||||||
|
|
|
@ -11,10 +11,6 @@
|
||||||
* Functions that operate on atoms.
|
* 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 */
|
/* Atoms */
|
||||||
/*********/
|
/*********/
|
||||||
|
@ -230,12 +226,11 @@ EAPI Ecore_X_Atom ECORE_X_ATOM_SELECTION_PROP_CLIPBOARD = 0;
|
||||||
the second one gets the replies and set the atoms. */
|
the second one gets the replies and set the atoms. */
|
||||||
|
|
||||||
#define FETCH_ATOM(s) \
|
#define FETCH_ATOM(s) \
|
||||||
ecore_xcb_atom_init_cookies[i] = \
|
atom_cookies[i] = xcb_intern_atom(_ecore_xcb_conn, 0, sizeof(s), s); \
|
||||||
xcb_intern_atom(_ecore_xcb_conn, 0, sizeof(s), s); \
|
|
||||||
i++
|
i++
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_x_atom_init(void)
|
_ecore_x_atom_init(xcb_intern_atom_cookie_t *atom_cookies)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
@ -411,7 +406,7 @@ _ecore_x_atom_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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];
|
xcb_intern_atom_reply_t *replies[ECORE_X_ATOMS_COUNT];
|
||||||
int i;
|
int i;
|
||||||
|
@ -420,7 +415,7 @@ _ecore_x_atom_init_finalize(void)
|
||||||
xcb_generic_error_t *error = NULL;
|
xcb_generic_error_t *error = NULL;
|
||||||
|
|
||||||
replies[i] = xcb_intern_atom_reply(_ecore_xcb_conn,
|
replies[i] = xcb_intern_atom_reply(_ecore_xcb_conn,
|
||||||
ecore_xcb_atom_init_cookies[i],
|
atom_cookies[i],
|
||||||
&error);
|
&error);
|
||||||
if (!replies[i]) {
|
if (!replies[i]) {
|
||||||
printf ("pas de reply %d\n", i);
|
printf ("pas de reply %d\n", i);
|
||||||
|
|
|
@ -227,8 +227,10 @@ extern Ecore_X_Atom ECORE_X_ATOM_WINDOW;
|
||||||
extern Ecore_X_Atom ECORE_X_ATOM_E_FRAME_SIZE;
|
extern Ecore_X_Atom ECORE_X_ATOM_E_FRAME_SIZE;
|
||||||
extern Ecore_X_Atom ECORE_X_ATOM_WM_SIZE_HINTS;
|
extern Ecore_X_Atom ECORE_X_ATOM_WM_SIZE_HINTS;
|
||||||
|
|
||||||
void _ecore_x_atom_init (void);
|
#define ECORE_X_ATOMS_COUNT 115
|
||||||
void _ecore_x_atom_init_finalize (void);
|
|
||||||
|
void _ecore_x_atom_init (xcb_intern_atom_cookie_t *);
|
||||||
|
void _ecore_x_atom_init_finalize (xcb_intern_atom_cookie_t *);
|
||||||
|
|
||||||
|
|
||||||
/* damage */
|
/* damage */
|
||||||
|
|
Loading…
Reference in New Issue