libctf: move string deduplication into ctf-archive

This means that any archive containing dicts can get its strings dedupped
together, rather than only those that are ctf_linked.

(For now, we are still constrained to ctf_linked archives, since fixing that
requires further changes to ctf_dedup_strings: but this gives us the first
half of what is necessary.)

libctf/
	* ctf-link.c (ctf_link_write): Move string dedup into...
	* ctf-archive.c (ctf_arc_preserialize): ... this new function.
	(ctf_arc_write_fd): Call it.
This commit is contained in:
Nick Alcock
2025-02-16 19:39:41 +00:00
parent 06f77d49f6
commit beccf36b88
4 changed files with 85 additions and 43 deletions

View File

@@ -792,6 +792,7 @@ _libctf_printflike_ (4, 5)
extern void ctf_err_warn (ctf_dict_t *, int is_warning, int err,
const char *, ...);
extern void ctf_err_warn_to_open (ctf_dict_t *);
extern void ctf_err_copy (ctf_dict_t *dest, ctf_dict_t *src);
extern void ctf_assert_fail_internal (ctf_dict_t *, const char *,
size_t, const char *);
extern const char *ctf_link_input_name (ctf_dict_t *);