aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-25 17:49:28 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-03 15:31:03 -0700
commit20e81c40735a5c98672900d3793f1cc8452b2471 (patch)
treec7e5c4badba7e3aa6b7d28c4bdd7233a3b7954b3 /tools/shared.py
parent8bd809c849bdce4533c0062010e0c88fc1b0d467 (diff)
begin work on memory relocation
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/shared.py b/tools/shared.py
index bc1177b2..1d70fcab 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1352,10 +1352,16 @@ chunkify = cache.chunkify
class JS:
memory_initializer_pattern = '/\* memory initializer \*/ allocate\(([\d,\.concat\(\)\[\]\\n ]+)"i8", ALLOC_NONE, Runtime\.GLOBAL_BASE\)'
+ no_memory_initializer_pattern = '/\* no memory initializer \*/'
@staticmethod
def to_nice_ident(ident): # limited version of the JS function toNiceIdent
- return ident.replace('%', '$').replace('@', '_');
+ return ident.replace('%', '$').replace('@', '_')
+
+ @staticmethod
+ def align(x, by):
+ while x % by != 0: x += 1
+ return x
# Compression of code and data for smaller downloads
class Compression: