aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-sexp.h
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-01-25 10:03:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-01-25 10:03:10 +0800
commit7ad01f8ebef4b1e297a623c2015424d330da5958 (patch)
treef17ec843259e6595e32c5716ac24b755dd847e03 /e-util/e-sexp.h
parent5bf4f88ae222d598431c5e5b7d54e2d67d742ab5 (diff)
downloadgsoc2013-evolution-7ad01f8ebef4b1e297a623c2015424d330da5958.tar.gz
gsoc2013-evolution-7ad01f8ebef4b1e297a623c2015424d330da5958.tar.zst
gsoc2013-evolution-7ad01f8ebef4b1e297a623c2015424d330da5958.zip
Add chunk allocators.
2001-01-24 Not Zed <NotZed@Ximian.com> * e-sexp.h (ESExp): Add chunk allocators. * e-sexp.c: Removed some redundant debug printfs. (e_sexp_term_eval): Dont allocate result till we have it. so we can have a fatal error, and not leak it. (term_eval_plus): If we have to abort, free our arguments. (term_eval_sub): Same. (parse_new_term): Renamed to parse_term_new for consistency. Fixed callers. (e_sexp_result_new): Add the esexp as an argument. Ouch, lots of code to change for this. Allocate blocks from an ememchunk. Fixed all callers. (e_sexp_result_free): Same as above, free blocks from the ememchunk. Fixed all callers. (parse_term_new): (parse_term_free): Similarly, add the esexp to the argument, and alloc/free from memchunks. Fixed all local callers. (e_sexp_init): Setup the memory chunk allocators. (e_sexp_finalise): Destroy memchunk allocators. svn path=/trunk/; revision=7795
Diffstat (limited to 'e-util/e-sexp.h')
-rw-r--r--e-util/e-sexp.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/e-util/e-sexp.h b/e-util/e-sexp.h
index 3584abcaf5..9299fdb61a 100644
--- a/e-util/e-sexp.h
+++ b/e-util/e-sexp.h
@@ -103,6 +103,11 @@ struct _ESExp {
/* private stuff */
jmp_buf failenv;
char *error;
+
+ /* TODO: may also need a pool allocator for term strings, so we dont lose them
+ in error conditions? */
+ struct _EMemChunk *term_chunks;
+ struct _EMemChunk *result_chunks;
};
struct _ESExpClass {
@@ -133,8 +138,8 @@ int e_sexp_parse (ESExp *f);
ESExpResult *e_sexp_eval (ESExp *f);
ESExpResult *e_sexp_term_eval (struct _ESExp *f, struct _ESExpTerm *t);
-ESExpResult *e_sexp_result_new (int type);
-void e_sexp_result_free (struct _ESExpResult *t);
+ESExpResult *e_sexp_result_new (struct _ESExp *f, int type);
+void e_sexp_result_free (struct _ESExp *f, struct _ESExpResult *t);
/* used in normal functions if they have to abort, to free their arguments */
void e_sexp_resultv_free (struct _ESExp *f, int argc, struct _ESExpResult **argv);