summaryrefslogtreecommitdiff
path: root/src/frames.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-11-27 16:01:14 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2007-11-27 16:01:14 +0000
commit5df40e280d3cbdf9e8b118c8451154d71b4b6872 (patch)
tree36688e976319fd1cdc84263524430729081ddc57 /src/frames.c
parent5ca9dbee35cc5f05c8e4abe96bda76e9143f6b2d (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.c19
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)
{