/* The elements below may be changed on every single request by any
* thread, and generally at the same time.
*/
- THREAD_PAD(63);
+ THREAD_ALIGN(64);
struct eb32_node idle_node; /* When to next do cleanup in the idle connections */
unsigned int curr_idle_conns; /* Current number of orphan idling connections, both the idle and the safe lists */
unsigned int curr_idle_nb; /* Current number of connections in the idle list */
/* Element below are usd by LB algorithms and must be doable in
* parallel to other threads reusing connections above.
*/
- THREAD_PAD(63);
+ THREAD_ALIGN(64);
__decl_thread(HA_SPINLOCK_T lock); /* may enclose the proxy's lock, must not be taken under */
union {
struct eb32_node lb_node; /* node used for tree-based load balancing */
};
/* usually atomically updated by any thread during parsing or on end of request */
- THREAD_PAD(63);
+ THREAD_ALIGN(64);
int cur_sess; /* number of currently active sessions (including syn_sent) */
int served; /* # of active sessions currently being served (ie not pending) */
int consecutive_errors; /* current number of consecutive errors */
struct be_counters counters; /* statistics counters */
/* Below are some relatively stable settings, only changed under the lock */
- THREAD_PAD(63);
+ THREAD_ALIGN(64);
struct eb_root *lb_tree; /* we want to know in what tree the server is */
struct tree_occ *lb_nodes; /* lb_nodes_tot * struct tree_occ */
*/
static inline struct server *srv_alloc(void)
{
- struct server *srv;
-
- srv = calloc(1, sizeof(*srv));
- return srv;
+ return ha_aligned_zalloc_typed(1, struct server);
}
/* free a previously allocated server an nullifies the pointer */
static inline void srv_free(struct server **srv_ptr)
{
- ha_free(srv_ptr);
+ ha_aligned_free(*srv_ptr);
+ *srv_ptr = NULL;
}
/* increase the number of cumulated streams on the designated server */