diff options
author | Robin Burchell <robin.burchell@collabora.com> | 2011-12-20 21:39:12 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-06 14:11:14 +0100 |
commit | b08daaedd45457b775cb90d2c2650510daff1c8d (patch) | |
tree | d68ea8016a15ee851813133a51897a7a81aedc16 /src/corelib/global/qmalloc.cpp | |
parent | 514ef34d1f838be119961003c0411a88352ba535 (diff) |
Remove all non-inline of qMalloc/qFree/qRealloc.
We're trying to deprecate these, so don't use them anymore.
The inline uses of these have been left intact, for the moment. Inline code will
need to create their own non-inline allocation methods (for future-proofing to
allow alterations in how e.g. individual containers allocate)
Change-Id: I1071a487c25e95b7bb81a3327b20c5481fb5ed22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/global/qmalloc.cpp')
-rw-r--r-- | src/corelib/global/qmalloc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp index 2da9e34b1e..2ec6938f98 100644 --- a/src/corelib/global/qmalloc.cpp +++ b/src/corelib/global/qmalloc.cpp @@ -78,7 +78,7 @@ void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t align void *actualptr = oldptr ? static_cast<void **>(oldptr)[-1] : 0; if (alignment <= sizeof(void*)) { // special, fast case - void **newptr = static_cast<void **>(qRealloc(actualptr, newsize + sizeof(void*))); + void **newptr = static_cast<void **>(realloc(actualptr, newsize + sizeof(void*))); if (!newptr) return 0; if (newptr == actualptr) { @@ -90,7 +90,7 @@ void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t align return newptr + 1; } - // qMalloc returns pointers aligned at least at sizeof(size_t) boundaries + // malloc returns pointers aligned at least at sizeof(size_t) boundaries // but usually more (8- or 16-byte boundaries). // So we overallocate by alignment-sizeof(size_t) bytes, so we're guaranteed to find a // somewhere within the first alignment-sizeof(size_t) that is properly aligned. @@ -98,7 +98,7 @@ void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t align // However, we need to store the actual pointer, so we need to allocate actually size + // alignment anyway. - void *real = qRealloc(actualptr, newsize + alignment); + void *real = realloc(actualptr, newsize + alignment); if (!real) return 0; |