ObjFW  Diff

Differences From Artifact [e7a8933e40]:

To Artifact [0b607ebca5]:


23
24
25
26
27
28
29
30
31
32









33
34
35
36
37
38
39
	size_t items;
}

/**
 * Creates a new OFArray whose items all have the same size.
 *
 * \param is The size of each element in the OFArray
 * \return A new allocated and initialized OFArray
 */
+ newWithItemSize: (size_t)is;










/**
 * Initializes an already allocated OFArray whose items all have the same size.
 *
 * \param is The size of each element in the OFArray
 * \return An initialized OFArray
 */







|

|
>
>
>
>
>
>
>
>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
	size_t items;
}

/**
 * Creates a new OFArray whose items all have the same size.
 *
 * \param is The size of each element in the OFArray
 * \return A new autoreleased OFArray
 */
+ arrayWithItemSize: (size_t)is;

/*
 * Creates a new OFArray optimized for big arrays whose items all have the same
 * size, which means memory is allocated in pages rather than in bytes.
 *
 * \param is The size of each element in the OFArray
 * \return A new autoreleased OFArray
 */
+ bigArrayWithItemSize: (size_t)is;

/**
 * Initializes an already allocated OFArray whose items all have the same size.
 *
 * \param is The size of each element in the OFArray
 * \return An initialized OFArray
 */
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
 * Removes a specified amount of the last items from the OFArray.
 *
 * \param nitems The number of items to remove
 */
- removeNItems: (size_t)nitems;
@end

/**
 * The OFBigArray class is nearly the same as the OFArray class, but it
 * allocates the memory rather in pages than in bytes.
 * This is faster, but needs more memory. It is especially useful if you want
 * to store large hunks of data.
 */
@interface OFBigArray: OFArray
{
	size_t size;
}

/**
 * Initializes an already allocated OFBigArray whose items all have the same
 * size.
 *
 * \param is The size of each element in the OFBigArray
 * \return An initialized OFBigArray
 */
- initWithItemSize: (size_t)is;

/**
 * Adds an item to the OFBigArray.
 *
 * \param item An arbitrary item
 */
- add: (void*)item;

/**
 * Adds items from a C array to the OFBigArray.
 *
 * \param nitems The number of items to add
 * \param carray A C array containing the items to add
 */
- addNItems: (size_t)nitems
 fromCArray: (void*)carray;

/**
 * Removes a specified amount of the last items from the OFBigArray.
 *
 * \param nitems The number of items to remove
 */
- removeNItems: (size_t)nitems;
@end







<
<
<
<
<
<





<
<
<
<
<
<
<

<
<
<
<
<
<

<
<
<
<
<
<
<


<
<
<
<
<
<


96
97
98
99
100
101
102






103
104
105
106
107







108






109







110
111






112
113
 * Removes a specified amount of the last items from the OFArray.
 *
 * \param nitems The number of items to remove
 */
- removeNItems: (size_t)nitems;
@end







@interface OFBigArray: OFArray
{
	size_t size;
}








- initWithItemSize: (size_t)is;






- add: (void*)item;







- addNItems: (size_t)nitems
 fromCArray: (void*)carray;






- removeNItems: (size_t)nitems;
@end