summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_poll.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-12-03 03:39:07 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2011-12-03 03:39:07 +0000
commit54a2db004437fc6f86718289cd5cdea66ff55ad3 (patch)
tree0b1bfe74b61520570f3d38b11654fed03d45ac97 /legacy/ecore/src/lib/ecore/ecore_poll.c
parentccf4af02aa2a341c0a7b121d1fa1417143fc1d65 (diff)
mempools++
SVN revision: 65833
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_poll.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_poll.c b/legacy/ecore/src/lib/ecore/ecore_poll.c
index a283cb51c5..f3c850a9db 100644
--- a/legacy/ecore/src/lib/ecore/ecore_poll.c
+++ b/legacy/ecore/src/lib/ecore/ecore_poll.c
@@ -7,16 +7,6 @@
7#include "Ecore.h" 7#include "Ecore.h"
8#include "ecore_private.h" 8#include "ecore_private.h"
9 9
10struct _Ecore_Poller
11{
12 EINA_INLIST;
13 ECORE_MAGIC;
14 int ibit;
15 unsigned char delete_me : 1;
16 Ecore_Task_Cb func;
17 void *data;
18};
19
20static Ecore_Timer *timer = NULL; 10static Ecore_Timer *timer = NULL;
21static int min_interval = -1; 11static int min_interval = -1;
22static int interval_incr = 0; 12static int interval_incr = 0;
@@ -159,7 +149,7 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
159 if (poller->delete_me) 149 if (poller->delete_me)
160 { 150 {
161 pollers[i] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(poller)); 151 pollers[i] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(poller));
162 free(poller); 152 ecore_poller_mp_free(poller);
163 poller_delete_count--; 153 poller_delete_count--;
164 changes++; 154 changes++;
165 if (poller_delete_count <= 0) break; 155 if (poller_delete_count <= 0) break;
@@ -281,7 +271,7 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__,
281 if (!func) return NULL; 271 if (!func) return NULL;
282 if (interval < 1) interval = 1; 272 if (interval < 1) interval = 1;
283 273
284 poller = calloc(1, sizeof(Ecore_Poller)); 274 poller = ecore_poller_calloc(1);
285 if (!poller) return NULL; 275 if (!poller) return NULL;
286 ECORE_MAGIC_SET(poller, ECORE_MAGIC_POLLER); 276 ECORE_MAGIC_SET(poller, ECORE_MAGIC_POLLER);
287 /* interval MUST be a power of 2, so enforce it */ 277 /* interval MUST be a power of 2, so enforce it */
@@ -413,7 +403,7 @@ ecore_poller_del(Ecore_Poller *poller)
413 /* not in loop so safe - delete immediately */ 403 /* not in loop so safe - delete immediately */
414 data = poller->data; 404 data = poller->data;
415 pollers[poller->ibit] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller)); 405 pollers[poller->ibit] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
416 free(poller); 406 ecore_poller_mp_free(poller);
417 _ecore_poller_next_tick_eval(); 407 _ecore_poller_next_tick_eval();
418 return data; 408 return data;
419} 409}
@@ -433,7 +423,7 @@ _ecore_poller_shutdown(void)
433 while ((poller = pollers[i])) 423 while ((poller = pollers[i]))
434 { 424 {
435 pollers[i] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(pollers[i])); 425 pollers[i] = (Ecore_Poller *)eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(pollers[i]));
436 free(poller); 426 ecore_poller_mp_free(poller);
437 } 427 }
438 } 428 }
439} 429}