ID | name | ID | name |
0 | passed (no error) | 2 | index out of range |
1 | out of memory | 3 | linked list not initialized |
4 | element sizes do not match |
Linked list errors, by number
Element sizes do not match (#4)
Two linked lists are being copied or compared whose elements have different byte sizes. This error is only thrown by the slow routines; since the fast routines do not check sizes they will probably crash the program if the sizes turn out to be unequal.
Index out of range (#2)
A non-existent index of a linked list was passed to a linked-list routine. An index of zero always causes this error, since Yazoo elements begin at 1. Alternatively, passing an index greater than the number of elements in the list causes an error. The exception to this latter rule is that InsertElements() allows the insertion point to be one greater than the top element, denoting that the new elements are to be added at the end of the list. None of the fast linked list routines check the ranges of their arguments, so they do not throw this error and will likely crash if a bad index is passed.
Linked list not initialized (#3)
A linked list was passed to a routine (other than NewLinkedList()) that was not initialized. An uninitialized list is marked by a null pointer in the memory field of the linkedlist variable. To initialize a list one must first clear the memory field, then make a successful call to NewLinkedList() or FNewLinkedList. The fast routines do not check initialization and crash when handed an uninitialized list..
Out of memory (#1)
Memory could not be allocated as requested. The linked list routines that throw this error are NewLinkedList() and InsertElements(), as well as their fast equivalents. It is, in theory, and probably only in theory, possible for DeleteElements() to also throw this error, because if all elements are deleted it tries to allocate a size-1 sublist -- but in practice this would never be a problem unless the computer was already really on the brink.
Last update: July 28, 2013