diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-11-27 16:01:14 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2007-11-27 16:01:14 +0000 |
commit | 5df40e280d3cbdf9e8b118c8451154d71b4b6872 (patch) | |
tree | 36688e976319fd1cdc84263524430729081ddc57 /src/frames.c | |
parent | 5ca9dbee35cc5f05c8e4abe96bda76e9143f6b2d (diff) |
Save a hash lookup.
Return the Frame instead of looking up the function names individually.
Diffstat (limited to 'src/frames.c')
-rw-r--r-- | src/frames.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/frames.c b/src/frames.c index 1a54b4c..2455858 100644 --- a/src/frames.c +++ b/src/frames.c @@ -1,16 +1,5 @@ #include "memfault.h" - -typedef struct _frame { - guint ip; - const gchar *function; - const gchar *object; - const gchar *file; - const gchar *directory; - gint line; - gchar *function_srcloc; - gboolean is_alloc_fn; - guint alloc_fns_serial; -} Frame; +#include "frames.h" struct _frames { GHashTable *frames; @@ -28,6 +17,12 @@ _frame_destroy (gpointer data) g_free (f); } +Frame * +frames_get (Frames *frames, guint ip) +{ + return g_hash_table_lookup (frames->frames, GUINT_TO_POINTER (ip)); +} + const gchar * frames_get_function (Frames *frames, guint ip) { |