forked from enlightenment/efl
parent
16b01952a9
commit
c76d3cea37
|
@ -46,7 +46,7 @@ static const char EINA_MAGIC_ACCESSOR_STR[] = "Eina Accessor";
|
|||
do { \
|
||||
if (!EINA_MAGIC_CHECK(d, EINA_MAGIC_ACCESSOR)) \
|
||||
EINA_MAGIC_FAIL(d, EINA_MAGIC_ACCESSOR); \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
* @endcond
|
||||
|
|
|
@ -142,7 +142,7 @@ static const char EINA_MAGIC_ARRAY_ACCESSOR_STR[] = "Eina Array Accessor";
|
|||
do { \
|
||||
if (!EINA_MAGIC_CHECK(d, EINA_MAGIC_ARRAY)) \
|
||||
EINA_MAGIC_FAIL(d, EINA_MAGIC_ARRAY); \
|
||||
} while (0);
|
||||
} while (0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_ARRAY_ITERATOR(d, ...) \
|
||||
do { \
|
||||
|
@ -151,7 +151,7 @@ static const char EINA_MAGIC_ARRAY_ACCESSOR_STR[] = "Eina Array Accessor";
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_ARRAY_ITERATOR); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while (0);
|
||||
} while (0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_ARRAY_ACCESSOR(d, ...) \
|
||||
do { \
|
||||
|
@ -160,7 +160,7 @@ static const char EINA_MAGIC_ARRAY_ACCESSOR_STR[] = "Eina Array Accessor";
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_ACCESSOR); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while (0);
|
||||
} while (0)
|
||||
|
||||
|
||||
typedef struct _Eina_Iterator_Array Eina_Iterator_Array;
|
||||
|
|
|
@ -46,7 +46,7 @@ static const char EINA_MAGIC_ITERATOR_STR[] = "Eina Iterator";
|
|||
do { \
|
||||
if (!EINA_MAGIC_CHECK(d, EINA_MAGIC_ITERATOR)) \
|
||||
EINA_MAGIC_FAIL(d, EINA_MAGIC_ITERATOR); \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
* @endcond
|
||||
|
|
|
@ -105,7 +105,7 @@ static const char EINA_MAGIC_LIST_ACCOUNTING_STR[] = "Eina List Accounting";
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_LIST); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_LIST_ITERATOR(d, ...) \
|
||||
do { \
|
||||
|
@ -114,7 +114,7 @@ static const char EINA_MAGIC_LIST_ACCOUNTING_STR[] = "Eina List Accounting";
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_LIST_ITERATOR); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_LIST_ACCESSOR(d, ...) \
|
||||
do { \
|
||||
|
@ -123,7 +123,7 @@ static const char EINA_MAGIC_LIST_ACCOUNTING_STR[] = "Eina List Accounting";
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_LIST_ACCESSOR); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_LIST_ACCOUNTING(d) \
|
||||
do { \
|
||||
|
@ -132,7 +132,7 @@ static const char EINA_MAGIC_LIST_ACCOUNTING_STR[] = "Eina List Accounting";
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_LIST_ACCOUNTING); \
|
||||
return; \
|
||||
} \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
#define EINA_LIST_SORT_STACK_SIZE 32
|
||||
|
||||
|
|
|
@ -70,9 +70,9 @@ static int _eina_log_dom = -1;
|
|||
#ifdef EFL_HAVE_PTHREAD
|
||||
static Eina_Bool _threads_activated = EINA_FALSE;
|
||||
static pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
#define LOCK() if(_threads_activated) pthread_mutex_lock(&_mutex);
|
||||
#define UNLOCK() if(_threads_activated) pthread_mutex_unlock(&_mutex);
|
||||
#define UNLOCK_FORCE() pthread_mutex_unlock(&_mutex);
|
||||
#define LOCK() if(_threads_activated) pthread_mutex_lock(&_mutex)
|
||||
#define UNLOCK() if(_threads_activated) pthread_mutex_unlock(&_mutex)
|
||||
#define UNLOCK_FORCE() pthread_mutex_unlock(&_mutex)
|
||||
#else
|
||||
#define LOCK() do {} while (0)
|
||||
#define UNLOCK() do {} while (0)
|
||||
|
|
|
@ -73,7 +73,7 @@ static const char EINA_MAGIC_MATRIXSPARSE_CELL_ITERATOR_STR[] = "Eina Matrixspar
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_MATRIXSPARSE); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_MATRIXSPARSE_ROW(d, ...) \
|
||||
do { \
|
||||
|
@ -82,7 +82,7 @@ static const char EINA_MAGIC_MATRIXSPARSE_CELL_ITERATOR_STR[] = "Eina Matrixspar
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_MATRIXSPARSE_ROW); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_MATRIXSPARSE_CELL(d, ...) \
|
||||
do { \
|
||||
|
@ -91,7 +91,7 @@ static const char EINA_MAGIC_MATRIXSPARSE_CELL_ITERATOR_STR[] = "Eina Matrixspar
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_MATRIXSPARSE_CELL); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_MATRIXSPARSE_ITERATOR(d, ...) \
|
||||
do { \
|
||||
|
@ -100,7 +100,7 @@ static const char EINA_MAGIC_MATRIXSPARSE_CELL_ITERATOR_STR[] = "Eina Matrixspar
|
|||
EINA_MAGIC_FAIL(d, EINA_MAGIC_MATRIXSPARSE_ITERATOR); \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while(0);
|
||||
} while(0)
|
||||
|
||||
struct _Eina_Matrixsparse_Cell
|
||||
{
|
||||
|
|
|
@ -82,13 +82,13 @@ struct _Eina_Rectangle_Alloc
|
|||
do { \
|
||||
if (!EINA_MAGIC_CHECK((d), EINA_RECTANGLE_POOL_MAGIC)) \
|
||||
EINA_MAGIC_FAIL((d), EINA_RECTANGLE_POOL_MAGIC); \
|
||||
} while (0);
|
||||
} while (0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_RECTANGLE_ALLOC(d) \
|
||||
do { \
|
||||
if (!EINA_MAGIC_CHECK((d), EINA_RECTANGLE_ALLOC_MAGIC)) \
|
||||
EINA_MAGIC_FAIL((d), EINA_RECTANGLE_ALLOC_MAGIC); \
|
||||
} while (0);
|
||||
} while (0)
|
||||
|
||||
static Eina_Mempool *_eina_rectangle_alloc_mp = NULL;
|
||||
static Eina_Mempool *_eina_rectangle_mp = NULL;
|
||||
|
|
|
@ -112,7 +112,7 @@ static const char EINA_MAGIC_STRINGSHARE_NODE_STR[] = "Eina Stringshare Node";
|
|||
unlock; \
|
||||
return __VA_ARGS__; \
|
||||
} \
|
||||
} while (0);
|
||||
} while (0)
|
||||
|
||||
#define EINA_MAGIC_CHECK_STRINGSHARE_NODE(d, unlock) \
|
||||
do { \
|
||||
|
@ -121,7 +121,7 @@ static const char EINA_MAGIC_STRINGSHARE_NODE_STR[] = "Eina Stringshare Node";
|
|||
unlock; \
|
||||
EINA_MAGIC_FAIL((d), EINA_MAGIC_STRINGSHARE_NODE); \
|
||||
} \
|
||||
} while (0);
|
||||
} while (0)
|
||||
|
||||
typedef struct _Eina_Stringshare Eina_Stringshare;
|
||||
typedef struct _Eina_Stringshare_Node Eina_Stringshare_Node;
|
||||
|
@ -186,9 +186,9 @@ static Eina_Bool _stringshare_threads_activated = EINA_FALSE;
|
|||
static pthread_mutex_t _mutex_small = PTHREAD_MUTEX_INITIALIZER;
|
||||
//string >= 4
|
||||
static pthread_mutex_t _mutex_big = PTHREAD_MUTEX_INITIALIZER;
|
||||
#define STRINGSHARE_LOCK_SMALL() if(_stringshare_threads_activated) pthread_mutex_lock(&_mutex_small);
|
||||
#define STRINGSHARE_UNLOCK_SMALL() if(_stringshare_threads_activated) pthread_mutex_unlock(&_mutex_small);
|
||||
#define STRINGSHARE_LOCK_BIG() if(_stringshare_threads_activated) pthread_mutex_lock(&_mutex_big);
|
||||
#define STRINGSHARE_LOCK_SMALL() if(_stringshare_threads_activated) pthread_mutex_lock(&_mutex_small)
|
||||
#define STRINGSHARE_UNLOCK_SMALL() if(_stringshare_threads_activated) pthread_mutex_unlock(&_mutex_small)
|
||||
#define STRINGSHARE_LOCK_BIG() if(_stringshare_threads_activated) pthread_mutex_lock(&_mutex_big)
|
||||
#define STRINGSHARE_UNLOCK_BIG() if(_stringshare_threads_activated) pthread_mutex_unlock(&_mutex_big);
|
||||
#else
|
||||
#define STRINGSHARE_LOCK_SMALL() do {} while (0)
|
||||
|
|
Loading…
Reference in New Issue