]> git.evergreen-ils.org Git - Evergreen.git/commit
This is a big commit. It started with a patch from Scott McKellar to
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 2 Dec 2007 02:27:33 +0000 (02:27 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 2 Dec 2007 02:27:33 +0000 (02:27 +0000)
commitf1766c7841c89651f79e408918773908ec5587da
tree97096936b592c3ee12d413f9babebfcb577a16d3
parente7ef29c9e9246f300f1dbcf71a5b19d9486daf2a
This is a big commit.  It started with a patch from Scott McKellar to
clean up several memory leaks in cstore and provide const-ification. I
was then inspired to add HAVING and multiple predicates per column support.

From Scott:

1. I applied the static qualifier to a number of functions, and a few
variables, that aren't referenced by other files.  I left as global
those functions that are registered for dynamic calls.

2. I found a number of cases where a call to buffer_data() was being
passed as a parameter to a function, guaranteeing a memory leak.  I
added code to capture the pointer returned by buffer_data() so that I
could free it later.

3. I added code to free a number of growing_buffers, jsonObjects,
and dynamically allocated buffers that were otherwise leaking.  In
some cases I had to juggle some extra pointers so that I could
distinguish between things I could delete and things I couldn't.  In
other cases I rearranged operations so that the freeing wouldn't get
bypassed.  I don't guarantee that I have plugged all the leaks.

4. Whenever possible I replaced buffer_data() with buffer_release(),
to eliminate a round of malloc() and free().  In some cases this
change enabled me to eliminate an intermediate variable.

5. Whenever possible I replaced jsonObjectGetKey() with
jsonObjectGetKeyConst().  Sometimes I had to juggle an extra pointer
or two in order to distinguish between what was const and what wasn't.

6. I applied the const qualifier to a number of local variables and
function parameters.

7. Here and there I changed double leading underscores to single
leading underscores.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@8123 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/src/c-apps/oils_cstore.c