/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to create/oracle-dom.cpp

  • Committer: Suren A. Chilingaryan
  • Date: 2009-09-23 17:13:04 UTC
  • Revision ID: csa@dside.dyndns.org-20090923171304-osvtr4zqb29h11kd
Intel, Tango, Phobos, and RapidXML parsers; Memory benchmark scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        fprintf(stderr,"Failed to initialze XML parser, error %u\n", (unsigned) ecode);
32
32
        exit(1);
33
33
    }
34
 
    mem = (char*)malloc(memsize);
35
 
    if (!mem) {
36
 
        fprintf(stderr,"Can't allocate memory!\n");
37
 
        exit(1);
 
34
 
 
35
    if (!td->memory_bench) {
 
36
        mem = (char*)malloc(memsize);
 
37
        if (!mem) {
 
38
            fprintf(stderr,"Can't allocate memory!\n");
 
39
            exit(1);
 
40
        }
38
41
    }
39
 
        
40
42
}
41
43
 
42
44
void releaseXML(struct TestData *td) {
43
45
    parser->xmlterm();
44
46
    delete parser;
45
 
    free(mem);
 
47
 
 
48
    if (!td->memory_bench) {
 
49
        free(mem);
 
50
    }
46
51
}
47
52
 
48
53
void parseXML(struct TestData *td, unsigned long iter) {
143
148
        node1->appendChild(doc->createTextNode((oratext*)str[i]));
144
149
    }
145
150
 
146
 
    doc->print((oratext*)mem,memsize,0,0);
 
151
    if (!td->memory_bench) {
 
152
        doc->print((oratext*)mem,memsize,0,0);
147
153
    
148
 
//    if (iter+1==td->iterations) puts(mem);
 
154
//      if (iter+1==td->iterations) puts(mem);
 
155
    }
149
156
 
150
157
//    parser->xmlclean();
151
158
    parser->xmlterm();