Per http://codereview.qt-project.org/#change,11562, we are trying to remove these
in favour of direct allocation, or (in the case of inline code) specialised
out-of-line wrappers.
Change-Id: I113609c4f97dc5c8020a72cbd398572cdb5b7505
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
else
stack_size <<= 1;
- sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
- state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
- location_stack = reinterpret_cast<AST::SourceLocation*> (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
- string_stack = reinterpret_cast<QStringRef*> (qRealloc(string_stack, stack_size * sizeof(QStringRef)));
+ sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value)));
+ state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int)));
+ location_stack = reinterpret_cast<AST::SourceLocation*> (realloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
+ string_stack = reinterpret_cast<QStringRef*> (realloc(string_stack, stack_size * sizeof(QStringRef)));
}
Parser::Parser(Engine *engine):
Parser::~Parser()
{
if (stack_size) {
- qFree(sym_stack);
- qFree(state_stack);
- qFree(location_stack);
- qFree(string_stack);
+ free(sym_stack);
+ free(state_stack);
+ free(location_stack);
+ free(string_stack);
}
}
else
stack_size <<= 1;
- sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
- state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
- location_stack = reinterpret_cast<AST::SourceLocation*> (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
- string_stack = reinterpret_cast<QStringRef*> (qRealloc(string_stack, stack_size * sizeof(QStringRef)));
+ sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value)));
+ state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int)));
+ location_stack = reinterpret_cast<AST::SourceLocation*> (realloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
+ string_stack = reinterpret_cast<QStringRef*> (realloc(string_stack, stack_size * sizeof(QStringRef)));
}
Parser::Parser(Engine *engine):
Parser::~Parser()
{
if (stack_size) {
- qFree(sym_stack);
- qFree(state_stack);
- qFree(location_stack);
- qFree(string_stack);
+ free(sym_stack);
+ free(state_stack);
+ free(location_stack);
+ free(string_stack);
}
}
QDeclarativeBoundSignalParameters::~QDeclarativeBoundSignalParameters()
{
delete [] types;
- qFree(myMetaObject);
+ free(myMetaObject);
}
void QDeclarativeBoundSignalParameters::setValues(void **v)
QDeclarativeOpenMetaObjectType::~QDeclarativeOpenMetaObjectType()
{
if (d->mem)
- qFree(d->mem);
+ free(d->mem);
if (d->cache)
d->cache->release();
delete d;
d->mob.addSignal("__" + QByteArray::number(id) + "()");
QMetaPropertyBuilder build = d->mob.addProperty(name, "QVariant", id);
propertyCreated(id, build);
- qFree(d->mem);
+ free(d->mem);
d->mem = d->mob.toMetaObject();
d->names.insert(name, id);
QSet<QDeclarativeOpenMetaObject*>::iterator it = d->referers.begin();
QDeclarativePropertyCacheMethodArguments *args = argumentsCache;
while (args) {
QDeclarativePropertyCacheMethodArguments *next = args->next;
- qFree(args);
+ free(args);
args = next;
}
QMetaMethod m = metaObject->method(index);
QList<QByteArray> argTypeNames = m.parameterTypes();
- A *args = static_cast<A *>(qMalloc(sizeof(A) + (argTypeNames.count() + 1) * sizeof(int)));
+ A *args = static_cast<A *>(malloc(sizeof(A) + (argTypeNames.count() + 1) * sizeof(int)));
args->arguments[0] = argTypeNames.count();
for (int ii = 0; ii < argTypeNames.count(); ++ii) {
type = EnumType(object->metaObject(), argTypeNames.at(ii));
if (type == QVariant::Invalid) {
if (unknownTypeError) *unknownTypeError = argTypeNames.at(ii);
- qFree(args);
+ free(args);
return 0;
}
args->arguments[ii + 1] = type;
QDeclarative1OpenMetaObjectType::~QDeclarative1OpenMetaObjectType()
{
if (d->mem)
- qFree(d->mem);
+ free(d->mem);
if (d->cache)
d->cache->release();
delete d;
d->mob.addSignal("__" + QByteArray::number(id) + "()");
QMetaPropertyBuilder build = d->mob.addProperty(name, "QVariant", id);
propertyCreated(id, build);
- qFree(d->mem);
+ free(d->mem);
d->mem = d->mob.toMetaObject();
d->names.insert(name, id);
QSet<QDeclarative1OpenMetaObject*>::iterator it = d->referers.begin();
{
if (propertyCache)
propertyCache->release();
- qFree(metaObject);
+ free(metaObject);
}
QMetaObject *metaObject;
}
if (m_type->metaObject)
- qFree(m_type->metaObject);
+ free(m_type->metaObject);
m_type->metaObject = m_type->builder.toMetaObject();
*static_cast<QMetaObject *>(this) = *m_type->metaObject;
QQuickVisualDataModelItemMetaType::~QQuickVisualDataModelItemMetaType()
{
- qFree(metaObject);
+ free(metaObject);
qPersistentDispose(constructor);
}
QSGGeometry::~QSGGeometry()
{
if (m_owns_data)
- qFree(m_data);
+ free(m_data);
if (m_server_data)
delete m_server_data;
int vertexByteSize = m_attributes.stride * m_vertex_count;
if (m_owns_data)
- qFree(m_data);
+ free(m_data);
if (canUsePrealloc && vertexByteSize <= (int) sizeof(m_prealloc)) {
m_data = (void *) &m_prealloc[0];
} else {
Q_ASSERT(m_index_type == GL_UNSIGNED_INT || m_index_type == GL_UNSIGNED_SHORT);
int indexByteSize = indexCount * (m_index_type == GL_UNSIGNED_SHORT ? sizeof(quint16) : sizeof(quint32));
- m_data = (void *) qMalloc(vertexByteSize + indexByteSize);
+ m_data = (void *) malloc(vertexByteSize + indexByteSize);
m_index_data_offset = vertexByteSize;
m_owns_data = true;
}
while (blocks) {
ElementBlock *block = blocks;
blocks = blocks->next;
- qFree(block);
+ free(block);
}
}
{
Q_ASSERT(blocks == 0);
Q_ASSERT(count > 0);
- blocks = (ElementBlock *)qMalloc(sizeof(ElementBlock) + (count - 1) * sizeof(Element));
+ blocks = (ElementBlock *)malloc(sizeof(ElementBlock) + (count - 1) * sizeof(Element));
blocks->blockSize = count;
blocks->next = 0;
blocks->firstFree = 0;
if (blocks->firstFree < blocks->blockSize)
return &blocks->elements[blocks->firstFree++];
ElementBlock *oldBlock = blocks;
- blocks = (ElementBlock *)qMalloc(sizeof(ElementBlock) + (oldBlock->blockSize - 1) * sizeof(Element));
+ blocks = (ElementBlock *)malloc(sizeof(ElementBlock) + (oldBlock->blockSize - 1) * sizeof(Element));
blocks->blockSize = oldBlock->blockSize;
blocks->next = oldBlock;
blocks->firstFree = 0;