Ignore:
Timestamp:
Apr 23, 2010, 11:45:44 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #2842 "Transmission crashes randomly on ARM-based Synology NAS" -- experimental commit based on giovannibajo's suggestion in comment:39 about the list struct's alignment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/list.c

    r9891 r10524  
    158158    return size;
    159159}
    160 
    161 
    162 
    163 /*
    164  * Double-linked list with easy memory management and fast
    165  * insert/remove operations
    166  */
    167 
    168 
    169 void
    170 __tr_list_insert( struct __tr_list * list,
    171                   struct __tr_list * prev,
    172                   struct __tr_list * next)
    173 {
    174     next->prev = list;
    175     list->next = next;
    176     list->prev = prev;
    177     prev->next = list;
    178 }
    179 
    180 static void
    181 __tr_list_splice( struct __tr_list * prev,
    182                   struct __tr_list * next)
    183 {
    184     next->prev = prev;
    185     prev->next = next;
    186 }
    187 
    188 void
    189 __tr_list_remove( struct __tr_list * head )
    190 {
    191     __tr_list_splice( head->prev, head->next );
    192     head->next = head->prev = NULL;
    193 }
    194 
    195 void
    196 __tr_list_destroy( struct __tr_list * head,
    197                    __tr_list_free_t   func)
    198 {
    199     while ( head->next != head )
    200     {
    201         struct __tr_list * list = head->next;
    202         __tr_list_splice( list->prev, list->next );
    203 
    204         func( list );
    205     }
    206 }
Note: See TracChangeset for help on using the changeset viewer.