diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-01-09 15:50:04 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-01-09 15:50:04 -0800 |
commit | 1020794b7ff51a4f168a73343f0674e71b0b279b (patch) | |
tree | 8520c2e17e3c4b2d4752658fe0c0bee6f5d72829 /lib.h | |
parent | 4e119128f89115dc5e1b00c00c2567ad550a04c3 (diff) | |
download | txr-1020794b7ff51a4f168a73343f0674e71b0b279b.tar.gz txr-1020794b7ff51a4f168a73343f0674e71b0b279b.tar.bz2 txr-1020794b7ff51a4f168a73343f0674e71b0b279b.zip |
Use struct instead of cons for lazy string fields.
* gc.c (finalize): Must free the dynamic structure attached
to the LSTR type now.
(mark_obj): Must mark interior of LSTR type's props structure.
* lib.c (lazy_sub_str, copy_lazy_str): Copy props structure.
(lazy_str): Allocate and initialize props structure.
(lazy_str_force, lazy_str_put, lazy_str_force_upto,
lazy_str_get_trailing_list, out_lazy_str): Follow
representation change.
* lib.h (struct lazy_string_props): New struct type.
(strut lazy_string): Member opts replaced with props
pointer to struct lazy_string_props.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -201,11 +201,17 @@ struct lazy_cons { * Lazy string: virtual string which dynamically grows as a catentation * of a list of strings. */ + +struct lazy_string_props { + val term; + val limit; +}; + struct lazy_string { obj_common; val prefix; /* actual string part */ val list; /* remaining list */ - val opts; /* ( separator . limit ) */ + struct lazy_string_props *props; }; struct cobj { |