git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] diff-delta: use realloc instead of xrealloc
@ 2007-05-29 19:08 Martin Koegler
  2007-05-29 23:51 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Koegler @ 2007-05-29 19:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Martin Koegler

Commit 83572c1a914d3f7a8dd66d954c11bbc665b7b923 changed many
realloc to xrealloc. This change was made in diff-delta.c too,
although the code can handle an out of memory failure.

This patch reverts this change in diff-delta.c.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
 diff-delta.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/diff-delta.c b/diff-delta.c
index 17757d2..faf96e4 100644
--- a/diff-delta.c
+++ b/diff-delta.c
@@ -388,7 +388,7 @@ create_delta(const struct delta_index *index,
 				outsize = max_size + MAX_OP_SIZE + 1;
 			if (max_size && outpos > max_size)
 				break;
-			out = xrealloc(out, outsize);
+			out = realloc(out, outsize);
 			if (!out) {
 				free(tmp);
 				return NULL;
-- 
1.5.2.846.g9a144

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] diff-delta: use realloc instead of xrealloc
  2007-05-29 19:08 [PATCH] diff-delta: use realloc instead of xrealloc Martin Koegler
@ 2007-05-29 23:51 ` Junio C Hamano
  2007-05-30  2:57   ` Nicolas Pitre
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2007-05-29 23:51 UTC (permalink / raw)
  To: Martin Koegler; +Cc: git

Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:

> Commit 83572c1a914d3f7a8dd66d954c11bbc665b7b923 changed many
> realloc to xrealloc. This change was made in diff-delta.c too,
> although the code can handle an out of memory failure.
>
> This patch reverts this change in diff-delta.c.

Wasn't there a discussion around this exact issue when the
original patch was applied?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] diff-delta: use realloc instead of xrealloc
  2007-05-29 23:51 ` Junio C Hamano
@ 2007-05-30  2:57   ` Nicolas Pitre
  2007-05-30  6:17     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2007-05-30  2:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Martin Koegler, git

On Tue, 29 May 2007, Junio C Hamano wrote:

> Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:
> 
> > Commit 83572c1a914d3f7a8dd66d954c11bbc665b7b923 changed many
> > realloc to xrealloc. This change was made in diff-delta.c too,
> > although the code can handle an out of memory failure.
> >
> > This patch reverts this change in diff-delta.c.
> 
> Wasn't there a discussion around this exact issue when the
> original patch was applied?

Maybe, but I cannot remember it, not can I justify that xrealloc now.


Nicolas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] diff-delta: use realloc instead of xrealloc
  2007-05-30  2:57   ` Nicolas Pitre
@ 2007-05-30  6:17     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2007-05-30  6:17 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Martin Koegler, git

Nicolas Pitre <nico@cam.org> writes:

> On Tue, 29 May 2007, Junio C Hamano wrote:
>
>> Wasn't there a discussion around this exact issue when the
>> original patch was applied?
>
> Maybe, but I cannot remember it, not can I justify that xrealloc now.

Actually, the discussion was older than the patch.

    http://thread.gmane.org/gmane.comp.version-control.git/43766/focus=43783

And I myself suggested to use non x- variant of allocation
routines in diff-delta.c as the callers know how to handle near
oom condition ;-).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-30  6:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-29 19:08 [PATCH] diff-delta: use realloc instead of xrealloc Martin Koegler
2007-05-29 23:51 ` Junio C Hamano
2007-05-30  2:57   ` Nicolas Pitre
2007-05-30  6:17     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).