mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
dc9f782ba5
commit
4a1c627474
2823 changed files with 619073 additions and 0 deletions
1
uppdev/valgrind/benchmark.txt
Normal file
1
uppdev/valgrind/benchmark.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
TIMING Parse : 53.0 ms - 5.3 ms ( 53.0 ms / 10 ), min: 5.0 ms, max: 6.0 ms, nesting: 1 - 10
|
||||
4
uppdev/valgrind/init
Normal file
4
uppdev/valgrind/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _valgrind_icpp_init_stub
|
||||
#define _valgrind_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
193
uppdev/valgrind/valgrind.cpp
Normal file
193
uppdev/valgrind/valgrind.cpp
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
static String s_ip = "ip";
|
||||
static String s_obj = "obj";
|
||||
static String s_fn = "fn";
|
||||
static String s_dir = "dir";
|
||||
static String s_file = "file";
|
||||
static String s_line = "line";
|
||||
static String s_stack = "stack";
|
||||
static String s_frame = "frame";
|
||||
|
||||
|
||||
void PS()
|
||||
{
|
||||
String txt = LoadFile(GetHomeDirFile("test.xml"));
|
||||
for(int I = 0; I < 100; I++) {
|
||||
RTIMING("Parse String");
|
||||
XmlParser p(txt);
|
||||
while(!p.IsTag())
|
||||
p.Skip();
|
||||
try {
|
||||
p.PassTag("valgrindoutput");
|
||||
while(!p.End()) {
|
||||
if(p.Tag("error")) {
|
||||
String hdr;
|
||||
while(!p.End()) {
|
||||
if(p.Tag("what")) {
|
||||
hdr = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag(s_stack)) {
|
||||
while(!p.End()) {
|
||||
String ip = "?";
|
||||
String obj;
|
||||
String fn;
|
||||
String dir;
|
||||
String file;
|
||||
String line;
|
||||
if(p.Tag(s_frame)) {
|
||||
bool hasdir = false;
|
||||
bool hasfile = false;
|
||||
bool hasline = false;
|
||||
bool haspos = false;
|
||||
while(!p.End()) {
|
||||
if(p.Tag(s_ip)) {
|
||||
ip = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag(s_obj)) {
|
||||
obj = p.ReadText();
|
||||
p.SkipEnd();
|
||||
haspos = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag(s_fn)) {
|
||||
fn = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag(s_dir)) {
|
||||
dir = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasdir = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag(s_file)) {
|
||||
file = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasfile = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag(s_line)) {
|
||||
line = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasline = true;
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
catch(XmlError) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PC()
|
||||
{
|
||||
String txt = LoadFile(GetHomeDirFile("test.xml"));
|
||||
for(int I = 0; I < 100; I++) {
|
||||
RTIMING("Parse char *");
|
||||
XmlParser p(txt);
|
||||
while(!p.IsTag())
|
||||
p.Skip();
|
||||
try {
|
||||
p.PassTag("valgrindoutput");
|
||||
while(!p.End()) {
|
||||
if(p.Tag("error")) {
|
||||
String hdr;
|
||||
while(!p.End()) {
|
||||
if(p.Tag("what")) {
|
||||
hdr = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag("stack")) {
|
||||
while(!p.End()) {
|
||||
String ip = "?";
|
||||
String obj;
|
||||
String fn;
|
||||
String dir;
|
||||
String file;
|
||||
String line;
|
||||
if(p.Tag("frame")) {
|
||||
bool hasdir = false;
|
||||
bool hasfile = false;
|
||||
bool hasline = false;
|
||||
bool haspos = false;
|
||||
while(!p.End()) {
|
||||
if(p.Tag("ip")) {
|
||||
ip = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag("obj")) {
|
||||
obj = p.ReadText();
|
||||
p.SkipEnd();
|
||||
haspos = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag("fn")) {
|
||||
fn = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag("dir")) {
|
||||
dir = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasdir = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag("file")) {
|
||||
file = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasfile = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag("line")) {
|
||||
line = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasline = true;
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
catch(XmlError) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
PS();
|
||||
PC();
|
||||
}
|
||||
9
uppdev/valgrind/valgrind.upp
Normal file
9
uppdev/valgrind/valgrind.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
benchmark.txt,
|
||||
valgrind.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
Loading…
Add table
Add a link
Reference in a new issue