Use ObjFW functions for memory management
FossilOrigin-Name: 71ebb79f8f6a5c2920c91b004bf274f9133e3ee04caddaf0f5ba01f98db27762
This commit is contained in:
parent
a28209edcf
commit
3d8735818d
10 changed files with 23 additions and 32 deletions
|
@ -25,6 +25,8 @@
|
|||
# include <new.h>
|
||||
#endif
|
||||
|
||||
#import <ObjFW/ObjFW.h>
|
||||
|
||||
#ifdef NULL
|
||||
# undef NULL
|
||||
#endif
|
||||
|
@ -127,7 +129,7 @@ template <class T> struct vector {
|
|||
vector()
|
||||
{
|
||||
alen = 8;
|
||||
buf = (T *)malloc(alen * sizeof(T));
|
||||
buf = (T *)OFAllocMemory(alen, sizeof(T));
|
||||
ulen = 0;
|
||||
}
|
||||
|
||||
|
@ -212,7 +214,7 @@ template <class T> struct vector {
|
|||
void
|
||||
realloc()
|
||||
{
|
||||
buf = (T *)::realloc(buf, (alen *= 2) * sizeof(T));
|
||||
buf = (T *)OFResizeMemory(buf, (alen *= 2), sizeof(T));
|
||||
}
|
||||
|
||||
T
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue