aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/TastyPickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-02-23 13:44:37 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-18 11:14:09 +0100
commitb32244b5b5e3a1209624966fce7073d2f5594f48 (patch)
tree335cecf1a0906ebe1e18d4cd87f2264c35457504 /src/dotty/tools/dotc/core/pickling/TastyPickler.scala
parent89c00f601678f58d0ddb424ffe680940f760eaeb (diff)
downloaddotty-b32244b5b5e3a1209624966fce7073d2f5594f48.tar.gz
dotty-b32244b5b5e3a1209624966fce7073d2f5594f48.tar.bz2
dotty-b32244b5b5e3a1209624966fce7073d2f5594f48.zip
Add UUID to Tasty
Tasty files now always carry a random UUID.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/TastyPickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/TastyPickler.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/TastyPickler.scala b/src/dotty/tools/dotc/core/pickling/TastyPickler.scala
index 32cc1ae43..ee0e5a8fa 100644
--- a/src/dotty/tools/dotc/core/pickling/TastyPickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/TastyPickler.scala
@@ -6,16 +6,20 @@ package pickling
import PickleFormat._
import collection.mutable
import TastyBuffer._
+import java.util.UUID
class TastyPickler {
private val sections = new mutable.ArrayBuffer[(TastyName.NameRef, TastyBuffer)]
private val headerBuffer = {
- val buf = new TastyBuffer(16)
+ val buf = new TastyBuffer(28)
for (ch <- header) buf.writeByte(ch.toByte)
buf.writeNat(MajorVersion)
buf.writeNat(MinorVersion)
+ val uuid = UUID.randomUUID()
+ buf.writeUncompressedLong(uuid.getMostSignificantBits)
+ buf.writeUncompressedLong(uuid.getLeastSignificantBits)
buf
}