diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2021-05-13 19:45:41 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2021-05-13 20:03:33 +0100 |
commit | a1af03965a04ad4e4e22978d47d87c858f479323 (patch) | |
tree | b778a7b91b28c2041df893d7d07525edf42e83dd /perf | |
parent | a84beea8c7bcf7180e1bd9bfe1481f41e4c4bd00 (diff) | |
download | libhubbub-a1af03965a04ad4e4e22978d47d87c858f479323.tar.gz libhubbub-a1af03965a04ad4e4e22978d47d87c858f479323.tar.bz2 |
Perf tester: Remove bogus library initialisation/finalisation calls.
Diffstat (limited to 'perf')
-rw-r--r-- | perf/hubbub.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/perf/hubbub.c b/perf/hubbub.c index d0ca8ec..70e0630 100644 --- a/perf/hubbub.c +++ b/perf/hubbub.c @@ -131,14 +131,11 @@ int main(int argc, char **argv) int fd; uint8_t *file; - if (argc != 3) { - printf("Usage: %s <aliases_file> <filename>\n", argv[0]); + if (argc != 2) { + printf("Usage: %s <filename>\n", argv[0]); return 1; } - /* Initialise library */ - assert(hubbub_initialise(argv[1], myrealloc, NULL) == HUBBUB_OK); - assert(hubbub_parser_create("UTF-8", false, myrealloc, NULL, &parser) == HUBBUB_OK); @@ -150,15 +147,13 @@ int main(int argc, char **argv) assert(hubbub_parser_setopt(parser, HUBBUB_PARSER_DOCUMENT_NODE, ¶ms) == HUBBUB_OK); - stat(argv[2], &info); - fd = open(argv[2], 0); + stat(argv[1], &info); + fd = open(argv[1], 0); file = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0); assert(hubbub_parser_parse_chunk(parser, file, info.st_size) == HUBBUB_OK); - assert(hubbub_finalise(myrealloc, NULL) == HUBBUB_OK); - return HUBBUB_OK; } |