summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e54c5ea)
raw | patch | inline | side by side (parent: e54c5ea)
author | Yasushi SHOJI <yashi@atmark-techno.com> | |
Sat, 13 Aug 2005 10:58:56 +0000 (19:58 +0900) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 14 Aug 2005 01:28:55 +0000 (18:28 -0700) |
When I run git-diff-tree on big change, it seems the command eats so
much memory. so I just put git under valgrind to see what's going on.
diff_free_filespec_data() doesn't free diff_filespec itself.
[jc: I ended up doing things slightly differently from Yasushi's
patch. The original idea was to use free_filespec_data() only to
free the data portion and keep useing the filespec itself, but
no existing code seems to do things that way, so I just yanked
that part out.]
Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
much memory. so I just put git under valgrind to see what's going on.
diff_free_filespec_data() doesn't free diff_filespec itself.
[jc: I ended up doing things slightly differently from Yasushi's
patch. The original idea was to use free_filespec_data() only to
free the data portion and keep useing the filespec itself, but
no existing code seems to do things that way, so I just yanked
that part out.]
Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c | patch | blob | history | |
diffcore-break.c | patch | blob | history | |
diffcore.h | patch | blob | history |
index 3e52fec18792056e230420bdeabff0f9dab5b35a..bb2a43b5b0725a5ef1896fcdd62e4d3e3ceccc04 100644 (file)
--- a/diff.c
+++ b/diff.c
return 0;
}
-void diff_free_filespec_data(struct diff_filespec *s)
+void diff_free_filespec(struct diff_filespec *s)
{
if (s->should_free)
free(s->data);
else if (s->should_munmap)
munmap(s->data, s->size);
- s->should_free = s->should_munmap = 0;
- s->data = NULL;
+ free(s);
}
static void prep_temp_blob(struct diff_tempfile *temp,
void diff_free_filepair(struct diff_filepair *p)
{
- diff_free_filespec_data(p->one);
- diff_free_filespec_data(p->two);
+ diff_free_filespec(p->one);
+ diff_free_filespec(p->two);
free(p);
}
diff --git a/diffcore-break.c b/diffcore-break.c
index 06f9a7f0ee25891ff6f4dd9646e39cd4c8b105fd..b0c8461e1243328795258f0fd7d12f509403403c 100644 (file)
--- a/diffcore-break.c
+++ b/diffcore-break.c
dp = diff_queue(outq, d->one, c->two);
dp->score = p->score;
- diff_free_filespec_data(d->two);
- diff_free_filespec_data(c->one);
+ diff_free_filespec(d->two);
+ diff_free_filespec(c->one);
free(d);
free(c);
}
diff --git a/diffcore.h b/diffcore.h
index f1b5ca748cae8d40f599552c3605080808da7803..633d1ae5cf708cca4b907f0f032294f78d7bbe18 100644 (file)
--- a/diffcore.h
+++ b/diffcore.h
unsigned short);
extern int diff_populate_filespec(struct diff_filespec *, int);
-extern void diff_free_filespec_data(struct diff_filespec *);
+extern void diff_free_filespec(struct diff_filespec *);
struct diff_filepair {
struct diff_filespec *one;