shithub: mc

Download patch

ref: 0cd717249cb46bdb6c067535eee2aacd4d63f9e3
parent: 13e55845018e40a4e943891a2cb371bc2a9cd572
author: Ori Bernstein <ori@eigenstate.org>
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