diff options
author | Pedro Alves <pedro@palves.net> | 2023-11-09 20:44:12 +0000 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2023-12-20 20:04:04 +0000 |
commit | d5cebea18e7a9a927f4dd4915d093feb7df0e029 (patch) | |
tree | 47a2f86caa6eb4d5ca55b28fd4181087e5ea2eef /gdb/regcache.h | |
parent | 5ac2d81b64af547cd7ac7251e9180730348572ad (diff) | |
download | binutils-d5cebea18e7a9a927f4dd4915d093feb7df0e029.zip binutils-d5cebea18e7a9a927f4dd4915d093feb7df0e029.tar.gz binutils-d5cebea18e7a9a927f4dd4915d093feb7df0e029.tar.bz2 |
Make cached_reg_t own its data
struct cached_reg_t owns its data buffer, but currently that is
managed manually. Convert it to use a unique_xmalloc_ptr.
Approved-By: Tom Tromey <tom@tromey.com>
Change-Id: I05a107098b717299e76de76aaba00d7fbaeac77b
Diffstat (limited to 'gdb/regcache.h')
-rw-r--r-- | gdb/regcache.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h index d90f74b..85890b6 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -176,7 +176,10 @@ using register_read_ftype struct cached_reg_t { int num; - gdb_byte *data; + gdb::unique_xmalloc_ptr<gdb_byte> data; + + cached_reg_t () = default; + cached_reg_t (cached_reg_t &&rhs) = default; }; /* Buffer of registers. */ |