You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/07/02 20:13:35 UTC

[GitHub] [daffodil] stevedlawrence commented on a change in pull request #600: Remove by-name and transient params for runtime data objects

stevedlawrence commented on a change in pull request #600:
URL: https://github.com/apache/daffodil/pull/600#discussion_r663228131



##########
File path: daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/EncodingRuntimeData.scala
##########
@@ -121,9 +113,9 @@ trait KnownEncodingMixin { self: ThrowsSDE =>
  */
 
 final class EncodingRuntimeData(
-  @TransientParam charsetEvArg: => CharsetEv,
+  val charsetEv: CharsetEv,
   override val schemaFileLocation: SchemaFileLocation,
-  optionUTF16WidthArg: Option[UTF16Width],
+  @TransientParam optionUTF16WidthArg: Option[UTF16Width],

Review comment:
       I thought we only needed (and wanted) the TransientParam annotation on the pass by name args that get evaluated in preSerilize. That way, during serialization the pass-by-name args are forced to be evaluated, stored in some other val, and then is null when deserializaed, effectively allowing garbage collection of those pass-by-name things that might contain pointers to compile time stuff.
   
   A TransientParam on a non-Arg thing seems wrong to me. It means after save/reload, that param will be null and could potentially lead to a NPE.
   
   And with the new Delay stuff, I don't think we need any TransietParam things anymore, since the Delay handles the nullification of the pass-by-name stuff once evaluated so it can be garbage collected. If we want, we can still make the the Delays transient if we force their evaluation and store in a val like we currently do, and never access the Delay again. But we could just always ask for the value of the delay if we need it rather store storing the value in another val. Then we can get rid of all this transient nonsense.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org