From 17eaa7a610e5becc0cd0afb02242214449302d76 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 4 May 2023 14:32:33 -0700 Subject: [PATCH] libsysprof-analyze: add various docs These functions have some transfer semantics, so even though they are private API, make sure that we document it for the future. --- src/libsysprof-analyze/sysprof-memory-map.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/libsysprof-analyze/sysprof-memory-map.c b/src/libsysprof-analyze/sysprof-memory-map.c index 4505f54c..6c265416 100644 --- a/src/libsysprof-analyze/sysprof-memory-map.c +++ b/src/libsysprof-analyze/sysprof-memory-map.c @@ -91,6 +91,17 @@ mapped_file_bsearch (gconstpointer keyptr, return 0; } +/** + * sysprof_memory_map_new: + * @mapped_files: (transfer full): a #GPtrArray of #SysprofMappedFile + * + * Creates a new #SysprofMemoryMap that can be used to locate a mapped + * file which contains a particular address within a target process. + * + * You should use SysprofMemoryMapBuilder instead of this function. + * + * Returns: (transfer full): a #SysprofMemoryMap + */ SysprofMemoryMap * sysprof_memory_map_new (GPtrArray *mapped_files) { @@ -107,6 +118,16 @@ sysprof_memory_map_new (GPtrArray *mapped_files) return self; } +/** + * sysprof_memory_map_find_at_address: + * @self: a #SysprofMemoryMap + * @address: an address + * + * Attempts to locate the #SysprofMappedFile which contains @address. + * + * Returns: (transfer none) (nullable): a #SysprofMappedFile if there + * was a mapping containing @address, otherwise %NULL. + */ SysprofMappedFile * sysprof_memory_map_find_at_address (SysprofMemoryMap *self, guint64 address)