[OPEN-ILS-DEV] Dead functions
Scott McKellar
mck9 at swbell.net
Mon Dec 15 18:26:46 EST 2008
In utils.c there is a function file_to_string(), which reads a file and
loads its contents into a growing_buffer.
This function is called in only two places:
1. By jsonParseFile() (residing in osrf_json_tools.c)
2. By json_parse_file() (residing in osrf_legacy_json.c)
These two functions are identical except in name. Each calls
file_to_string() to load a file into a string, and then parses the
string to create a jsonObject.
jsonParseFile() isn't called from anywhere. json_parse_file() is
called only by a thin wrapper named legacy_jsonParseFile(), which
isn't called from anywhere.
Two questions:
1. Can we get rid of this whole gaggle of unused functions?
2. If we want to keep some form of jsonParseFile(), would it make sense
to use mmap() instead of loading the file into a growing_buffer? I
suspect that a memory-mapped file would be faster to read, but I
haven't tried to benchmark it.
Scott McKellar
http://home.swbell.net/mck9/ct/
More information about the Open-ils-dev
mailing list