diff options
author | Martin Odersky <odersky@gmail.com> | 2016-11-19 13:42:36 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-11-19 13:42:36 +0100 |
commit | ca8def4b01369ffbb367b9bb6531dfc1ae4e7936 (patch) | |
tree | 37d669377c9c0c00eaa4d3198961909f20a6ed0b /src | |
parent | ddec688b6e165c68cdd9a33dac968ee4a09b447a (diff) | |
download | dotty-ca8def4b01369ffbb367b9bb6531dfc1ae4e7936.tar.gz dotty-ca8def4b01369ffbb367b9bb6531dfc1ae4e7936.tar.bz2 dotty-ca8def4b01369ffbb367b9bb6531dfc1ae4e7936.zip |
Plug another space leak.
`initInfo` was retained in Symbols. When called from `Namer`, `initInfo` referred to
a completer, which referred to a context.
With this space leak plugged, we can now compile 1000 times core/Comments.scala (460lines)
with -Xmx400M.
There still seems to be a space leak on the order of 200KB per run, though. But that seems
to have to do with symbols, not contexts.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 6 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/ProtoTypes.scala | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index fb6a40100..8b7c28e19 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -105,7 +105,7 @@ object SymDenotations { ownerIfExists: Symbol, final val name: Name, initFlags: FlagSet, - final val initInfo: Type, + initInfo: Type, initPrivateWithin: Symbol = NoSymbol) extends SingleDenotation(symbol) { //assert(symbol.id != 4940, name) @@ -232,7 +232,7 @@ object SymDenotations { case _ => } */ - if (Config.checkNoSkolemsInInfo) assertNoSkolems(initInfo) + if (Config.checkNoSkolemsInInfo) assertNoSkolems(tp) myInfo = tp } @@ -751,7 +751,7 @@ object SymDenotations { // def isOverridable: Boolean = !!! need to enforce that classes cannot be redefined def isSkolem: Boolean = name == nme.SKOLEM - def isInlineMethod(implicit ctx: Context): Boolean = is(InlineMethod, butNot = Accessor) + def isInlineMethod(implicit ctx: Context): Boolean = is(InlineMethod, butNot = Accessor) // ------ access to related symbols --------------------------------- diff --git a/src/dotty/tools/dotc/typer/ProtoTypes.scala b/src/dotty/tools/dotc/typer/ProtoTypes.scala index 5eef096db..9a20a452e 100644 --- a/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -477,11 +477,9 @@ object ProtoTypes { def apply(tp: Type) = wildApprox(tp, this) } - @sharable private def dummyTree = untpd.Literal(Constant(null)) - /** Dummy tree to be used as an argument of a FunProto or ViewProto type */ object dummyTreeOfType { - def apply(tp: Type): Tree = dummyTree withTypeUnchecked tp + def apply(tp: Type): Tree = untpd.Literal(Constant(null)) withTypeUnchecked tp def unapply(tree: Tree): Option[Type] = tree match { case Literal(Constant(null)) => Some(tree.typeOpt) case _ => None |