Browse Source
merge connection_list_append() into connection_fdwaitqueue_append() (not converted to singly-linked-list since fdwaitqueue is not expected to be used during normal operation (except extreme overload condition), so use allocated list of pointers (allocated when needed) instead of adding ptr member to (every) allocated struct connection) remove connections-glue.c remove inclusion of connections.h by non-base filesmaster
11 changed files with 12 additions and 29 deletions
@ -1,18 +0,0 @@
|
||||
#include "first.h" |
||||
|
||||
#include "base.h" |
||||
#include "connections.h" |
||||
|
||||
#include <stdlib.h> |
||||
|
||||
__attribute_cold__ |
||||
static void connection_list_resize(connections *conns) { |
||||
conns->size += 16; |
||||
conns->ptr = realloc(conns->ptr, sizeof(*conns->ptr) * conns->size); |
||||
force_assert(NULL != conns->ptr); |
||||
} |
||||
|
||||
void connection_list_append(connections *conns, connection *con) { |
||||
if (conns->used == conns->size) connection_list_resize(conns); |
||||
conns->ptr[conns->used++] = con; |
||||
} |
Loading…
Reference in new issue