1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-05 02:00:25 +08:00

優化padding

This commit is contained in:
源文雨
2023-11-08 15:32:39 +09:00
parent a9f26280f5
commit 733db95c22
2 changed files with 4 additions and 4 deletions

View File

@@ -31,14 +31,14 @@ static inline uint32_t last_nonnull(const char* p, uint32_t max_size);
#define TCPOOL_THREADCNT THREADCNT
#define TCPOOL_MAXWAITSEC MAXWAITSEC
#define TCPOOL_THREAD_CONTEXT \
ssize_t numbytes; \
char *dat; \
uint8_t buf[ \
TCPOOL_THREAD_TIMER_T_SZ \
-TCPOOL_THREAD_TIMER_T_HEAD_SZ \
-sizeof(ssize_t) \
-sizeof(char*) \
]; \
ssize_t numbytes; \
char *dat
]
static dict_t setdicts[THREADCNT];
static uint32_t* items_len;

View File

@@ -77,9 +77,9 @@ struct tcpool_thread_timer_t {
pthread_cond_t tc; // lock by tmc
pthread_mutex_t tmc; // lock tc&hastimerslept
pthread_rwlock_t mb; // lock isbusy
TCPOOL_THREAD_CONTEXT;
uint8_t isbusy; // lock by mb
uint8_t hastimerslept; // lock by tmc
TCPOOL_THREAD_CONTEXT;
};
typedef struct tcpool_thread_timer_t tcpool_thread_timer_t;