- if (width > MAX_SHORT_STRING)
- value->long_string = pool_alloc_unaligned (pool, width);
+ if (width > 0)
+ value->s = pool_alloc_unaligned (pool, width);
+}
+
+/* Same as value_clone(), except that memory for VALUE (if necessary) is
+ allocated from POOL and will be freed automatically when POOL is destroyed.
+
+ VALUE must not be freed manually by calling value_destroy(). If it needs to
+ be resized, it must be done using value_resize_pool() instead of
+ value_resize(). */
+void
+value_clone_pool (struct pool *pool,
+ union value *value, const union value *src, int width)
+{
+ if (width > 0)
+ value->s = pool_clone_unaligned (pool, src->s, width);
+ else
+ value->f = src->f;