aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2013-12-31 19:03:22 +0100
committerDrahflow <drahflow@gmx.de>2013-12-31 19:03:22 +0100
commit620eff4a9037aab7489b9cf04825ee1e8f7a686c (patch)
tree6885ec04503423a91a946e5b1c2324a1fff6aca0
parentc78a4ce84fd37064b8db7e5fc7a9b3fb23631179 (diff)
Further reductions of memory waste
-rw-r--r--compiler/elymasAsmLib.ey18
-rw-r--r--compiler/standardClient.ey6
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