{"thread":{"id":"8351","subject":"[PATCH] diff-delta: use realloc instead of xrealloc","startedAt":"2007-05-29T19:08:35Z","lastAt":"2007-05-30T06:17:01Z","messageCount":4,"participants":["Martin Koegler","Junio C Hamano","Nicolas Pitre"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"43581","messageId":"1180465715346-git-send-email-mkoegler@auto.tuwien.ac.at","threadId":"8351","inReplyTo":null,"subject":"[PATCH] diff-delta: use realloc instead of xrealloc","fromName":"Martin Koegler","fromEmail":"mkoegler@auto.tuwien.ac.at","sentAt":"2007-05-29T19:08:35Z","receivedAt":"2007-05-29T19:08:35Z","isPatch":true,"sender":{"key":"mkoegler@auto.tuwien.ac.at","avatar":null},"body":"Commit 83572c1a914d3f7a8dd66d954c11bbc665b7b923 changed many\nrealloc to xrealloc. This change was made in diff-delta.c too,\nalthough the code can handle an out of memory failure.\n\nThis patch reverts this change in diff-delta.c.\n\nSigned-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>\n---\n diff-delta.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/diff-delta.c b/diff-delta.c\nindex 17757d2..faf96e4 100644\n--- a/diff-delta.c\n+++ b/diff-delta.c\n@@ -388,7 +388,7 @@ create_delta(const struct delta_index *index,\n \t\t\t\toutsize = max_size + MAX_OP_SIZE + 1;\n \t\t\tif (max_size && outpos > max_size)\n \t\t\t\tbreak;\n-\t\t\tout = xrealloc(out, outsize);\n+\t\t\tout = realloc(out, outsize);\n \t\t\tif (!out) {\n \t\t\t\tfree(tmp);\n \t\t\t\treturn NULL;\n-- \n1.5.2.846.g9a144\n"},{"id":"43591","messageId":"7v1wgz5gus.fsf@assigned-by-dhcp.cox.net","threadId":"8351","inReplyTo":"1180465715346-git-send-email-mkoegler@auto.tuwien.ac.at","subject":"Re: [PATCH] diff-delta: use realloc instead of xrealloc","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-29T23:51:07Z","receivedAt":"2007-05-29T23:51:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:\n\n> Commit 83572c1a914d3f7a8dd66d954c11bbc665b7b923 changed many\n> realloc to xrealloc. This change was made in diff-delta.c too,\n> although the code can handle an out of memory failure.\n>\n> This patch reverts this change in diff-delta.c.\n\nWasn't there a discussion around this exact issue when the\noriginal patch was applied?\n"},{"id":"43601","messageId":"alpine.LFD.0.99.0705292252220.11491@xanadu.home","threadId":"8351","inReplyTo":"7v1wgz5gus.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] diff-delta: use realloc instead of xrealloc","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-05-30T02:57:06Z","receivedAt":"2007-05-30T02:57:06Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Tue, 29 May 2007, Junio C Hamano wrote:\n\n> Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:\n> \n> > Commit 83572c1a914d3f7a8dd66d954c11bbc665b7b923 changed many\n> > realloc to xrealloc. This change was made in diff-delta.c too,\n> > although the code can handle an out of memory failure.\n> >\n> > This patch reverts this change in diff-delta.c.\n> \n> Wasn't there a discussion around this exact issue when the\n> original patch was applied?\n\nMaybe, but I cannot remember it, not can I justify that xrealloc now.\n\n\nNicolas\n"},{"id":"43620","messageId":"7vhcpu4yzm.fsf@assigned-by-dhcp.cox.net","threadId":"8351","inReplyTo":"alpine.LFD.0.99.0705292252220.11491@xanadu.home","subject":"Re: [PATCH] diff-delta: use realloc instead of xrealloc","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-05-30T06:17:01Z","receivedAt":"2007-05-30T06:17:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Pitre <nico@cam.org> writes:\n\n> On Tue, 29 May 2007, Junio C Hamano wrote:\n>\n>> Wasn't there a discussion around this exact issue when the\n>> original patch was applied?\n>\n> Maybe, but I cannot remember it, not can I justify that xrealloc now.\n\nActually, the discussion was older than the patch.\n\n    http://thread.gmane.org/gmane.comp.version-control.git/43766/focus=43783\n\nAnd I myself suggested to use non x- variant of allocation\nroutines in diff-delta.c as the callers know how to handle near\noom condition ;-).\n"}]}