summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-01-09 15:50:04 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-01-09 15:50:04 -0800
commit1020794b7ff51a4f168a73343f0674e71b0b279b (patch)
tree8520c2e17e3c4b2d4752658fe0c0bee6f5d72829 /lib.h
parent4e119128f89115dc5e1b00c00c2567ad550a04c3 (diff)
downloadtxr-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.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib.h b/lib.h
index 7b2a4f0f..93ab96bb 100644
--- a/lib.h
+++ b/lib.h
@@ -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 {