shithub: mc

Download patch

ref: e3cc33a12eb5fa84acea188d1c03a64f4154bdad
parent: 80483aa913c9f4bc672f11eccaab0496ec6dec7c
author: Ori Bernstein <[email protected]>
date: Fri Dec 26 11:30:30 EST 2014

actually return the start of the new memory after brk().

--- a/libstd/syswrap+plan9-x64.myr
+++ b/libstd/syswrap+plan9-x64.myr
@@ -119,14 +119,15 @@
 
 /* memory stuff */
 const getmem	= {sz
-	var endp
+	var endp, oldp
 
+	oldp = sys.curbrk
 	endp = (sys.curbrk castto(intptr)) + (sz castto(intptr))
 	if sys.brk_(endp castto(byte#)) < 0
 		-> Failmem
 	;;
 	sys.curbrk = endp castto(byte#)
-	-> sys.curbrk
+	-> oldp
 }
 	
 const freemem = {p, sz