From 620eff4a9037aab7489b9cf04825ee1e8f7a686c Mon Sep 17 00:00:00 2001 From: Drahflow Date: Tue, 31 Dec 2013 19:03:22 +0100 Subject: Further reductions of memory waste --- compiler/elymasAsmLib.ey | 18 +++++++++++++++--- compiler/standardClient.ey | 6 +++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/compiler/elymasAsmLib.ey b/compiler/elymasAsmLib.ey index b1d87c3..c92dd9f 100644 --- a/compiler/elymasAsmLib.ey +++ b/compiler/elymasAsmLib.ey @@ -19,10 +19,22 @@ 9 ==mmap > ==SYSCALL + 0 ==constantAllocBegin + 0 ==constantAllocEnd + { =*def ==struct - struct values |cat fold :arrayToCode _ :globalAllocations .register - .base ==address - struct keys { address -101 def struct -01 . len address add =address } each + struct values |cat fold ==data + constantAllocEnd constantAllocBegin sub ==constantAllocFree + data len constantAllocFree gt { + data len 1 sub :PAGESIZE div 1 add :PAGESIZE mul :alloc ==area + area :globalAllocations .register + area .base _ constantAllocEnd neq { area .base =constantAllocBegin } rep + area .size add =constantAllocEnd + } rep + + sys .asm .|poke =*poke + constantAllocBegin _ ==i data { -101 poke 1 add } each =constantAllocBegin + struct keys { i -101 def struct -01 . len i add =i } each } /allocateOffsetStruct deff { ==str diff --git a/compiler/standardClient.ey b/compiler/standardClient.ey index 47e9cc2..2288159 100644 --- a/compiler/standardClient.ey +++ b/compiler/standardClient.ey @@ -336,9 +336,9 @@ matched { currentCapture ==i { i } { i 1 sub =i - string - i 2 mul matchedThread threadGetCaptures * _ ==start -01 str .postfix - i 2 mul 1 add matchedThread threadGetCaptures * start sub -01 str .inplacePrefix + i 2 mul matchedThread threadGetCaptures * + i 2 mul 1 add matchedThread threadGetCaptures * + string str .infix } loop } rep matched -- cgit v1.2.3