version 1.14.2.1, 2012/02/23 17:09:16
|
version 1.14.2.2, 2012/02/24 14:10:09
|
Line 78 typedef struct _tagArray {
|
Line 78 typedef struct _tagArray {
|
void **arr_data; |
void **arr_data; |
} array_t; |
} array_t; |
|
|
/* Memory pool */ |
|
|
|
struct tagAlloc { |
|
char *alloc_name; |
|
unsigned int *alloc_mem; |
|
SLIST_ENTRY(tagAlloc) alloc_node; |
|
}; |
|
typedef SLIST_HEAD(, tagAlloc) mpool_bucket_t; |
|
#define io_memory(x, _type) (assert((x)), (_type) ((x)->alloc_mem ? ((x)->alloc_mem + 2) : NULL)) |
|
#define io_memorySize(x) (assert((x)), (x)->alloc_mem ? *(x)->alloc_mem : 0) |
|
#define io_memoryZero(x) do { assert((x)); \ |
|
if ((x)->alloc_mem) \ |
|
memset((void*) ((x)->alloc_mem + 2), 0, *(x)->alloc_mem); \ |
|
} while (0) |
|
|
|
typedef struct _tagMPool { |
|
pthread_mutex_t pool_mtx; |
|
|
|
struct { |
|
unsigned long alloc; |
|
unsigned long free; |
|
} pool_calls; |
|
struct { |
|
unsigned long alloc; |
|
unsigned long free; |
|
} pool_bytes; |
|
struct { |
|
unsigned int max; |
|
unsigned int curr; |
|
} pool_res; |
|
|
|
/* pool buckets start from 4k block == 0 position in array */ |
|
mpool_bucket_t pool_bucks[20]; |
|
} mpool_t; |
|
|
|
/* URL staff ... */ |
/* URL staff ... */ |
|
|
typedef struct _tagURLItem { |
typedef struct _tagURLItem { |