]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf: simplify ctf_txlate
authorNick Alcock <nick.alcock@oracle.com>
Thu, 3 Apr 2025 14:21:47 +0000 (15:21 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 25 Apr 2025 17:07:41 +0000 (18:07 +0100)
commita80b903b45313cb6b17b79395d6bdb5bf016bc02
tree8340f2093e22c3a228aba7b2cfe417d49fb1b2b1
parent1d70873382b3f917fc643f63646b3c2b8d0941d0
libctf: simplify ctf_txlate

Before now, this critical internal structure was an array mapping from a
type ID to the type index of the type with that ID.  This was critical for
the old world in which ctf_update() reserialized the entire dict, so things
moved around in memory all the time: but these days, a ctf_type_t * never
moves after creation, so we can just make ctf_txlate an array of ctf_type_t *
and be done with it.

This lets us point type indexes anywhere in memory, not just to entries
in the ctf_buf, which means we can have synthetic ones for various purposes.
And we will.
libctf/ctf-impl.h
libctf/ctf-open.c