src/cx/linked_list.h

changeset 526
b070ef465313
parent 508
8aea65ae1eaf
child 528
4fbfac557df8
     1.1 --- a/src/cx/linked_list.h	Mon Apr 18 15:59:09 2022 +0200
     1.2 +++ b/src/cx/linked_list.h	Mon Apr 18 16:29:14 2022 +0200
     1.3 @@ -48,7 +48,8 @@
     1.4  /**
     1.5   * Allocates a linked list for storing elements with \p item_size bytes each.
     1.6   *
     1.7 - * Elements added to the list are copied.
     1.8 + * @remark Elements added to the list are copied, therefore a possible cx_list_s.content_destructor
     1.9 + * MUST NOT free the memory pointed to by its argument.
    1.10   *
    1.11   * @param allocator the allocator for allocating the list nodes
    1.12   * @param comparator the comparator for the elements
    1.13 @@ -66,6 +67,9 @@
    1.14   *
    1.15   * If you want to store the elements directly in this list, use cxLinkedListCreate().
    1.16   *
    1.17 + * @remark Since only pointers are stored in this list, a possible cx_list_s.content_destructor
    1.18 + * MAY free the memory pointed to by its argument in order to prevent memory leaks.
    1.19 + *
    1.20   * @param allocator the allocator for allocating the list nodes
    1.21   * @param comparator the comparator for the elements
    1.22   * @return the created list
    1.23 @@ -78,6 +82,9 @@
    1.24  /**
    1.25   * Creates a linked list using the data from an array.
    1.26   *
    1.27 + * @remark Elements added to the list are copied, therefore a possible cx_list_s.content_destructor
    1.28 + * MUST NOT free the memory pointed to by its argument.
    1.29 + *
    1.30   * @param allocator the allocator for allocating the list nodes
    1.31   * @param comparator the comparator for the elements
    1.32   * @param item_size the size of one item in the array

mercurial