42 #include "qplatformdefs.h" 55 return ::malloc(size);
65 return ::realloc(ptr, size);
73 void *
qReallocAligned(
void *oldptr,
size_t newsize,
size_t oldsize,
size_t alignment)
78 void *actualptr = oldptr ?
static_cast<void **
>(oldptr)[-1] : 0;
79 if (alignment <=
sizeof(
void*)) {
81 void **newptr =
static_cast<void **
>(
qRealloc(actualptr, newsize +
sizeof(
void*)));
84 if (newptr == actualptr) {
101 void *real =
qRealloc(actualptr, newsize + alignment);
106 faked &= ~(alignment - 1);
108 void **faked_ptr =
reinterpret_cast<void **
>(faked);
113 faked_ptr[-1] = real;
122 void **ptr2 =
static_cast<void **
>(
ptr);
QIntegerForSizeof< void * >::Unsigned quintptr
#define QT_END_NAMESPACE
This macro expands to.
void * qMallocAligned(size_t size, size_t alignment)
void * qMalloc(size_t size)
#define QT_BEGIN_NAMESPACE
This macro expands to.
const T * ptr(const T &t)
void qFreeAligned(void *ptr)
void * qRealloc(void *ptr, size_t size)
void * qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t alignment)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...