Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/adlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ list *listAddNodeHeadDRAM(list *list, void *value)
* On error, NULL is returned and no operation is performed (i.e. the
* list remains unaltered).
* On success the 'list' pointer you pass to the function is returned. */
list *listAddNodeTail(list *list, void *value)
list *_listAddNodeTail(list *list, void *value, int on_dram)
{
listNode *node;

Expand All @@ -189,6 +189,14 @@ list *listAddNodeTail(list *list, void *value)
return list;
}

list *listAddNodeTail(list *list, void *value) {
return _listAddNodeTail(list, value, LIST_GENERAL_VARIANT);
}

list *listAddNodeTailDRAM(list *list, void *value) {
return _listAddNodeTail(list, value, LIST_DRAM_VARIANT);
}

list *listInsertNode(list *list, listNode *old_node, void *value, int after) {
listNode *node;

Expand Down
1 change: 1 addition & 0 deletions src/adlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void listEmptyDRAM(list *list);
list *listAddNodeHead(list *list, void *value);
list *listAddNodeHeadDRAM(list *list, void *value);
list *listAddNodeTail(list *list, void *value);
list *listAddNodeTailDRAM(list *list, void *value);
list *listInsertNode(list *list, listNode *old_node, void *value, int after);
void listDelNode(list *list, listNode *node);
void listDelNodeDRAM(list *list, listNode *node);
Expand Down
2 changes: 1 addition & 1 deletion src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int listMatchObjects(void *a, void *b) {
/* This function links the client to the global linked list of clients.
* unlinkClient() does the opposite, among other things. */
void linkClient(client *c) {
listAddNodeTail(server.clients,c);
listAddNodeTailDRAM(server.clients,c);
/* Note that we remember the linked list node where the client is stored,
* this way removing the client in unlinkClient() will not require
* a linear scan, but just a constant time operation. */
Expand Down