code review 5949043: realloc: bug, realloc does not update tailptr. (issue 5949043)

3 views
Skip to first unread message

enrique...@gmail.com

unread,
Mar 28, 2012, 7:06:46 PM3/28/12
to nixi...@gmail.com, nix...@googlegroups.com, re...@codereview-hr.appspotmail.com
Reviewers: Nixie,

Message:
Hello nixi...@gmail.com (cc: nix...@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/nix-os/


Description:
realloc: bug, realloc does not update tailptr.

Please review this at http://codereview.appspot.com/5949043/

Affected files:
M sys/src/nix/k10/qmalloc.c


Index: sys/src/nix/k10/qmalloc.c
===================================================================
--- a/sys/src/nix/k10/qmalloc.c
+++ b/sys/src/nix/k10/qmalloc.c
@@ -592,12 +592,14 @@
if(ounits > nunits){
p->s.size = nunits;
tailsize += ounits-nunits;
+ tailptr -= ounits-nunits;
MUNLOCK;
return ap;
}
if(tailsize >= nunits-ounits){
p->s.size = nunits;
tailsize -= nunits-ounits;
+ tailptr += nunits-ounits;
MUNLOCK;
return ap;
}


John Floren

unread,
Mar 30, 2012, 6:39:38 PM3/30/12
to nix...@googlegroups.com
LGTM

Gorka Guardiola

unread,
Mar 30, 2012, 7:13:06 PM3/30/12
to nix...@googlegroups.com
Lgtm
Reply all
Reply to author
Forward
0 new messages