]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/bootstrap/image/image.factor
Merge branch 'master' into new_gc
[factor.git] / basis / bootstrap / image / image.factor
index 421a7d2ecdac0019b52535e2348dec5a273e9d2e..6d2dfe332edad0a13be416bc82c6adbc0beb17e5 100644 (file)
@@ -217,8 +217,12 @@ USERENV: undefined-quot 60
 
 : here-as ( tag -- pointer ) here bitor ;
 
+: (align-here) ( alignment -- )
+    [ here neg ] dip rem
+    [ bootstrap-cell /i [ 0 emit ] times ] unless-zero ;
+
 : align-here ( -- )
-    here 8 mod 4 = [ 0 emit ] when ;
+    data-alignment get (align-here) ;
 
 : emit-fixnum ( n -- ) tag-fixnum emit ;
 
@@ -292,7 +296,7 @@ M: fake-bignum ' n>> tag-fixnum ;
 M: float '
     [
         float [
-            align-here double>bits emit-64
+            8 (align-here) double>bits emit-64
         ] emit-object
     ] cache-eql-object ;
 
@@ -410,6 +414,7 @@ M: byte-array '
     [
         byte-array [
             dup length emit-fixnum
+            bootstrap-cell 4 = [ 0 emit 0 emit ] when
             pad-bytes emit-bytes
         ] emit-object
     ] cache-eq-object ;