summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@collabora.com>2012-01-06 18:56:17 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-01-12 20:56:56 +0100
commitb7f3d5518859a2baec4f1a52bf029da64bcd5844 (patch)
tree81bea2de826036cf808b1df6c3b4445ee4cc611d
parenta06d43173c0909de58d260121013a8b5bda02b96 (diff)
Remove out-of-line uses of qMalloc/qFree/qRealloc.
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: I4d6580da66b9e1bd27a1d0c78f757ccf0aa7c034 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
-rw-r--r--examples/glsl/glsl.g8
-rw-r--r--src/lalr.g6
-rw-r--r--src/recognizer.cpp6
3 files changed, 10 insertions, 10 deletions
diff --git a/examples/glsl/glsl.g b/examples/glsl/glsl.g
index 1970bef..ba61f2f 100644
--- a/examples/glsl/glsl.g
+++ b/examples/glsl/glsl.g
@@ -209,8 +209,8 @@ inline void GLSLParser::reallocateStack()
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)));
+ sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value)));
+ state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int)));
}
:/
@@ -229,8 +229,8 @@ GLSLParser::GLSLParser():
GLSLParser::~GLSLParser()
{
if (stack_size) {
- qFree(sym_stack);
- qFree(state_stack);
+ free(sym_stack);
+ free(state_stack);
}
}
diff --git a/src/lalr.g b/src/lalr.g
index 14a3409..a849fbc 100644
--- a/src/lalr.g
+++ b/src/lalr.g
@@ -249,7 +249,7 @@ Recognizer::Recognizer (Grammar *grammar, bool no_lines):
Recognizer::~Recognizer()
{
if (stack_size)
- ::qFree(state_stack);
+ ::free(state_stack);
}
inline void Recognizer::reallocateStack()
@@ -262,9 +262,9 @@ inline void Recognizer::reallocateStack()
sym_stack.resize (stack_size);
if (! state_stack)
- state_stack = reinterpret_cast<int*> (::qMalloc(stack_size * sizeof(int)));
+ state_stack = reinterpret_cast<int*> (::malloc(stack_size * sizeof(int)));
else
- state_stack = reinterpret_cast<int*> (::qRealloc(state_stack, stack_size * sizeof(int)));
+ state_stack = reinterpret_cast<int*> (::realloc(state_stack, stack_size * sizeof(int)));
}
int Recognizer::nextToken()
diff --git a/src/recognizer.cpp b/src/recognizer.cpp
index 9e27d33..ea9be44 100644
--- a/src/recognizer.cpp
+++ b/src/recognizer.cpp
@@ -58,7 +58,7 @@ Recognizer::Recognizer (Grammar *grammar, bool no_lines):
Recognizer::~Recognizer()
{
if (stack_size)
- ::qFree(state_stack);
+ ::free(state_stack);
}
inline void Recognizer::reallocateStack()
@@ -71,9 +71,9 @@ inline void Recognizer::reallocateStack()
sym_stack.resize (stack_size);
if (! state_stack)
- state_stack = reinterpret_cast<int*> (::qMalloc(stack_size * sizeof(int)));
+ state_stack = reinterpret_cast<int*> (::malloc(stack_size * sizeof(int)));
else
- state_stack = reinterpret_cast<int*> (::qRealloc(state_stack, stack_size * sizeof(int)));
+ state_stack = reinterpret_cast<int*> (::realloc(state_stack, stack_size * sizeof(int)));
}
int Recognizer::nextToken()