projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
precomputed states almost ok, needs testing
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
lttv
/
traceset.c
diff --git
a/ltt/branches/poly/lttv/lttv/traceset.c
b/ltt/branches/poly/lttv/lttv/traceset.c
index 0e91c9dcf00ee7000daf34b344d83826430afc9a..181bdd53430de5739316262bc618ebc1e29a2d40 100644
(file)
--- a/
ltt/branches/poly/lttv/lttv/traceset.c
+++ b/
ltt/branches/poly/lttv/lttv/traceset.c
@@
-16,6
+16,9
@@
* MA 02111-1307, USA.
*/
* MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <lttv/traceset.h>
#include <lttv/iattribute.h>
#include <lttv/traceset.h>
#include <lttv/iattribute.h>
@@
-71,7
+74,7
@@
LttvTrace *lttv_trace_new(LttTrace *t)
LttvTraceset *lttv_traceset_copy(LttvTraceset *s_orig)
{
LttvTraceset *lttv_traceset_copy(LttvTraceset *s_orig)
{
- int i;
+
gu
int i;
LttvTraceset *s;
LttvTrace * trace;
LttvTraceset *s;
LttvTrace * trace;
@@
-83,13
+86,10
@@
LttvTraceset *lttv_traceset_copy(LttvTraceset *s_orig)
trace = g_ptr_array_index(s_orig->traces, i);
trace->ref_count++;
trace = g_ptr_array_index(s_orig->traces, i);
trace->ref_count++;
- /*CHECK this used ltt_trace_copy while it may not be needed. Need to
- define how traces and tracesets are shared */
- g_ptr_array_add(
- s->traces,
- g_ptr_array_index(s_orig->traces, i));
+ g_ptr_array_add(s->traces,
+ trace);
}
}
- s->a = LTTV_ATTRIBUTE(lttv_iattribute_deep_copy(
(LttvIAttribute*)s_orig->a
));
+ s->a = LTTV_ATTRIBUTE(lttv_iattribute_deep_copy(
LTTV_IATTRIBUTE(s_orig->a)
));
return s;
}
return s;
}
@@
-122,6
+122,14
@@
gint lttv_traceset_save(LttvTraceset *s)
void lttv_traceset_destroy(LttvTraceset *s)
{
void lttv_traceset_destroy(LttvTraceset *s)
{
+ guint i;
+
+ for(i=0;i<s->traces->len;i++) {
+ LttvTrace *trace = g_ptr_array_index(s->traces, i);
+ lttv_trace_unref(trace);
+ if(lttv_trace_get_ref_number(trace) == 0)
+ lttv_trace_destroy(trace);
+ }
g_ptr_array_free(s->traces, TRUE);
g_object_unref(s->a);
g_free(s);
g_ptr_array_free(s->traces, TRUE);
g_object_unref(s->a);
g_free(s);
@@
-198,7
+206,7
@@
guint lttv_trace_ref(LttvTrace * t)
guint lttv_trace_unref(LttvTrace * t)
{
guint lttv_trace_unref(LttvTrace * t)
{
- if(
t->ref_count > 0
)
+ if(
likely(t->ref_count > 0)
)
t->ref_count--;
return t->ref_count;
t->ref_count--;
return t->ref_count;
This page took
0.027822 seconds
and
4
git commands to generate.