Lines Matching refs:impl

31   IntArrayListImpl* impl;
35 impl = NEW(IntArrayListImpl, MTAG);
36 if (impl == NULL)
38 impl->Interface.add = &IntArrayList_Add;
39 impl->Interface.contains = &IntArrayList_Contains;
40 impl->Interface.destroy = &IntArrayList_Destroy;
41 impl->Interface.get = &IntArrayList_Get;
42 impl->Interface.getSize = &IntArrayList_GetSize;
43 impl->Interface.remove = &IntArrayList_Remove;
44 impl->Interface.removeAll = &IntArrayList_RemoveAll;
45 impl->Interface.set = &IntArrayList_Set;
46 impl->Interface.toStaticArray = &IntArrayList_ToStaticArray;
47 impl->contents = MALLOC((INITIAL_SIZE + 1) * sizeof(int), MTAG);
48 if (impl->contents == NULL)
50 FREE(impl);
53 impl->actualSize = INITIAL_SIZE;
54 impl->virtualSize = 0;
55 *self = (IntArrayList*) impl;
62 IntArrayListImpl* impl;
67 impl = (IntArrayListImpl*) self;
68 impl->contents = value;
76 IntArrayListImpl* impl = (IntArrayListImpl*) self;
78 if (impl->virtualSize >= impl->actualSize)
81 int* temp = REALLOC(impl->contents, (impl->actualSize * 2 + 1) * sizeof(int));
84 impl->contents = temp;
85 impl->actualSize *= 2;
87 impl->contents[impl->virtualSize] = element;
88 ++impl->virtualSize;
94 IntArrayListImpl* impl = (IntArrayListImpl*) self;
95 int* contents = impl->contents; /* cache pointer */
96 size_t virtualSize = impl->virtualSize; /* cache value */
111 impl->virtualSize = virtualSize; /* flush cache */
112 if (virtualSize <= impl->actualSize / 4)
115 impl->contents = REALLOC(contents, (impl->actualSize / 2 + 1) * sizeof(int));
116 passert(impl->contents != NULL); /* should never fail */
117 impl->actualSize /= 2;
124 IntArrayListImpl* impl = (IntArrayListImpl*) self;
126 impl->virtualSize = 0;
132 IntArrayListImpl* impl = (IntArrayListImpl*) self;
134 size_t virtualSize = impl->virtualSize; /* cache value */
135 int* contents = impl->contents; /* cache value */
151 IntArrayListImpl* impl = (IntArrayListImpl*) self;
153 passert(index >= 0 && index <= impl->virtualSize);
154 *element = impl->contents[index];
160 IntArrayListImpl* impl = (IntArrayListImpl*) self;
162 passert(index >= 0 && index <= impl->virtualSize);
163 impl->contents[index] = element;
169 IntArrayListImpl* impl = (IntArrayListImpl*) self;
171 *size = impl->virtualSize;
177 IntArrayListImpl* impl = (IntArrayListImpl*) self;
179 *newArray = impl->contents;
180 impl->contents = NULL; /* prevent free() from deallocating buffer */
186 IntArrayListImpl* impl = (IntArrayListImpl*) self;
188 FREE(impl->contents);
189 FREE(impl);