From 35632941c90f406f69512c9559ae7ba561f7eee8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 21 Apr 2019 09:12:47 -0600 Subject: Convert target dcache to type-safe registry API This changes the target dcache to use the type-safe registry API. gdb/ChangeLog 2019-05-08 Tom Tromey * target-dcache.c (target_dcache_cleanup): Remove. (target_dcache_aspace_key): Change type. (target_dcache_init_p, target_dcache_invalidate) (target_dcache_get, target_dcache_get_or_init) (_initialize_target_dcache): Update. * dcache.h (struct dcache_deleter): New. --- gdb/dcache.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gdb/dcache.h') diff --git a/gdb/dcache.h b/gdb/dcache.h index 9c29074c919..a58ac840d12 100644 --- a/gdb/dcache.h +++ b/gdb/dcache.h @@ -34,6 +34,15 @@ DCACHE *dcache_init (void); /* Free a DCACHE. */ void dcache_free (DCACHE *); +/* A deletion adapter that calls dcache_free. */ +struct dcache_deleter +{ + void operator() (DCACHE *d) const + { + dcache_free (d); + } +}; + enum target_xfer_status dcache_read_memory_partial (struct target_ops *ops, DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr, -- cgit v1.2.1