Changeset 14 for trunk/src/helpers/linklist.c
- Timestamp:
- Dec 9, 2000, 8:19:42 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/linklist.c
r8 r14 57 57 /* 58 58 * Copyright (C) 1997-2000 Ulrich Mller. 59 * This file is part of the XWorkplacesource package.60 * XWorkplaceis free software; you can redistribute it and/or modify59 * This file is part of the "XWorkplace helpers" source package. 60 * This is free software; you can redistribute it and/or modify 61 61 * it under the terms of the GNU General Public License as published 62 62 * by the Free Software Foundation, in version 2 as it comes in the … … 82 82 83 83 /* ****************************************************************** 84 * *85 * List base functions *86 * *84 * 85 * List base functions 86 * 87 87 ********************************************************************/ 88 89 /* 90 *@@ lstMalloc: 91 * wrapper around malloc() to make sure memory is 92 * allocated from the C runtime the helpers were 93 * compiled with. This is useful for auto-free 94 * lists. 95 * 96 *@@added V0.9.7 (2000-12-07) [umoeller] 97 */ 98 99 void* lstMalloc(size_t size) 100 { 101 return (malloc(size)); 102 } 103 104 /* 105 *@@ lstStrDup: 106 * wrapper around strdup() to make sure memory is 107 * allocated from the C runtime the helpers were 108 * compiled with. This is useful for auto-free 109 * lists. 110 * 111 *@@added V0.9.7 (2000-12-07) [umoeller] 112 */ 113 114 void* lstStrDup(const char *pcsz) 115 { 116 return (strdup(pcsz)); 117 } 88 118 89 119 /* … … 111 141 * you're storing other objects, such as numbers 112 142 * or other static items. 143 * 144 * This of course will be a "flat" free(). If 145 * you store structures in the list using other 146 * heap pointers, auto-free would cause memory leaks. 147 * 148 * Also, auto-free only works if the malloc() that 149 * has been used on the list item is in the same C 150 * runtime as with the linklist functions. If the 151 * caller uses a different runtime (e.g. from a DLL), 152 * it can use lstMalloc() for allocating the list 153 * item and still use auto-free. 113 154 * 114 155 * Note: You better call lstInit only once per list, … … 758 799 759 800 /* ****************************************************************** 760 * *761 * List sorting *762 * *801 * 802 * List sorting 803 * 763 804 ********************************************************************/ 764 805 … … 933 974 934 975 /* ****************************************************************** 935 * *936 * List pseudo-stacks *937 * *976 * 977 * List pseudo-stacks 978 * 938 979 ********************************************************************/ 939 980
Note:
See TracChangeset
for help on using the changeset viewer.