Implement this function
authorSøren Sandmann <sandmann@redhat.com>
Sat, 7 May 2005 17:57:59 +0000 (17:57 +0000)
committerSøren Sandmann Pedersen <ssp@src.gnome.org>
Sat, 7 May 2005 17:57:59 +0000 (17:57 +0000)
Sat May  7 13:57:17 2005  Søren Sandmann  <sandmann@redhat.com>

* sfile.c (sfile_output_free): Implement this function

* sfile.c (sfile_input_free): Implement this function

ChangeLog
binfile.c
profile.c
sfile.c
sfile.h

index 9a9d22f..69660e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat May  7 13:57:17 2005  Søren Sandmann  <sandmann@redhat.com>
+
+       * sfile.c (sfile_output_free): Implement this function
+       
+       * sfile.c (sfile_input_free): Implement this function
+
 Fri May  6 23:38:48 2005  Søren Sandmann  <sandmann@redhat.com>
 
        * sysprof-module.c (do_generate): Another desparate hack to try
index e4bdc54..2019347 100644 (file)
--- a/binfile.c
+++ b/binfile.c
@@ -180,7 +180,7 @@ separate_debug_file_exists (const char *name, unsigned long crc)
     return crc == file_crc;
 }
 
-/* FIXME: this should be detected by config.h */
+/* FIXME - not10: this should probably be detected by config.h -- find out what gdb does*/
 static const char *debug_file_directory = "/usr/lib/debug";
 
 static char *
index 97f02d3..f128ae9 100644 (file)
--- a/profile.c
+++ b/profile.c
@@ -212,7 +212,7 @@ profile_load (const char *filename, GError **err)
     sfile_begin_get_record (input, "profile");
 
     sfile_get_integer (input, "size", &profile->size);
-    sfile_get_pointer (input, "call_tree", &profile->call_tree);
+    sfile_get_pointer (input, "call_tree", (void **)&profile->call_tree);
 
     n = sfile_begin_get_list (input, "objects");
     for (i = 0; i < n; ++i)
@@ -295,7 +295,7 @@ generate_key (Process *process, gulong address)
 static char *
 generate_presentation_name (Process *process, gulong address)
 {
-    /* FIXME using 0 to indicate "process" is broken */
+    /* FIXME - not10 - using 0 to indicate "process" is broken */
     if (address)
     {
        const Symbol *symbol = process_lookup_symbol (process, address);
@@ -306,10 +306,6 @@ generate_presentation_name (Process *process, gulong address)
     {
        return g_strdup_printf ("%s", process_get_cmdline (process));
     }
-#if 0
-    /* FIXME - don't return addresses and stuff */
-    return generate_key (profile, process, address);
-#endif
 }
 
 static void
diff --git a/sfile.c b/sfile.c
index 076c797..e26d087 100644 (file)
--- a/sfile.c
+++ b/sfile.c
@@ -353,6 +353,9 @@ sformat_new_union (const char *name,
 }
 #endif
 
+#define RECORD_SHIFT   (sizeof (SType) * 8 - 1)
+#define LIST_SHIFT     (sizeof (SType) * 8 - 2)
+    
 static SType
 define_type (SType *type, SType fallback)
 {
@@ -369,6 +372,20 @@ define_type (SType *type, SType fallback)
     return fallback;
 }
 
+static gboolean
+is_record_type (SType type)
+{
+    /* FIMXE - not10 */
+    return TRUE;
+}
+
+static gboolean
+is_list_type (SType type)
+{
+    /* FIXME - not10 */
+    return TRUE;
+}
+
 gpointer
 sformat_new_record  (const char *     name,
                      SType           *type,
@@ -641,20 +658,6 @@ struct SFileInput
     GHashTable *instructions_by_location;
 };
 
-static gboolean
-is_record_type (SType type)
-{
-    /* FIXME */
-    return TRUE;
-}
-
-static gboolean
-is_list_type (SType type)
-{
-    /* FIXME */
-    return TRUE;
-}
-
 void
 sfile_begin_get_record (SFileInput *file, const char *name)
 {
@@ -1610,13 +1613,26 @@ sfile_output_save (SFileOutput  *sfile,
 void
 sfile_input_free       (SFileInput  *file)
 {
-    /* FIXME */
+    free_instructions (file->instructions, file->n_instructions);
+
+    g_hash_table_destroy (file->instructions_by_location);
+
+    g_free (file);
 }
 
 void
 sfile_output_free (SFileOutput *sfile)
 {
-    /* FIXME */
+    Instruction *instructions;
+    int n_instructions;
+
+    n_instructions = sfile->instructions->len;
+    instructions = g_array_free (sfile->instructions, FALSE);
+
+    free_instructions (instructions, n_instructions);
+
+    g_hash_table_destroy (sfile->objects);
+    g_free (sfile);
 }
 
 
diff --git a/sfile.h b/sfile.h
index b35c551..838f7d8 100644 (file)
--- a/sfile.h
+++ b/sfile.h
@@ -27,9 +27,9 @@ typedef guint SType;
  *
  * Serializer *serializer_new (SerializerFormat *format);
  *
- * SerializerReadContext *serializer_begin_read (serializer *serialize,
- *                                              const char *filename,
- *                                               GError *err);
+ * SerializerReadContext *serializer_begin_read_filename (serializer *serialize,
+ *                                                       const char *filename,
+ *                                                        GError *err);
  * serializer_get_blah (SerializerReadContext *);
  * void serialzier_end_read (...);
  *
@@ -82,8 +82,10 @@ void     sformat_free        (SFormat    *format);
 SFileInput *  sfile_load        (const char  *filename,
                                 SFormat       *format,
                                 GError     **err);
-void     sfile_begin_get_record (SFileInput  *file, const char *name);
-int      sfile_begin_get_list   (SFileInput  *file, const char *name);
+void     sfile_begin_get_record (SFileInput  *file,
+                                const char *name);
+int      sfile_begin_get_list   (SFileInput  *file,
+                                const char *name);
 void     sfile_get_pointer      (SFileInput  *file,
                                 const char *name,
                                 gpointer    *pointer);
@@ -111,9 +113,9 @@ void         sfile_loader_free     (SFileLoader  *loader);
 
 /* - Writing - */
 
-/* FIXME: see if we can't get rid of the names. It should be
-= * possible to pass NULL to state_transition_check() and
- * have it interprete that as "whatever". We would need
+/* FIXME - not10: see if we can't get rid of the names. It
+ * should be possible to pass NULL to state_transition_check()
+ * and have it interprete that as "whatever". We would need
  * a way to get the name back then, though.
  */