@@ -58,7 +58,7 @@ Hash::Hash(Environment* env, Local<Object> wrap) : BaseObject(env, wrap) {
5858
5959void Hash::MemoryInfo (MemoryTracker* tracker) const {
6060 tracker->TrackFieldWithSize (" mdctx" , mdctx_ ? kSizeOf_EVP_MD_CTX : 0 );
61- tracker->TrackFieldWithSize ( " md" , digest_ ? md_len_ : 0 );
61+ tracker->TraitTrackInline (digest_, " md" );
6262}
6363
6464#if NCRYPTO_USE_BORINGSSL_EVP_DO_ALL_FALLBACK
@@ -543,10 +543,7 @@ void Hash::HashDigest(const FunctionCallbackInfo<Value>& args) {
543543}
544544
545545HashConfig::HashConfig (HashConfig&& other) noexcept
546- : mode(other.mode),
547- in (std::move(other.in)),
548- digest(other.digest),
549- length(other.length) {}
546+ : in(std::move(other.in)), digest(other.digest), length(other.length) {}
550547
551548HashConfig& HashConfig::operator =(HashConfig&& other) noexcept {
552549 if (&other == this ) return *this ;
@@ -555,8 +552,7 @@ HashConfig& HashConfig::operator=(HashConfig&& other) noexcept {
555552}
556553
557554void HashConfig::MemoryInfo (MemoryTracker* tracker) const {
558- // If the Job is sync, then the HashConfig does not own the data.
559- if (IsCryptoJobAsync (mode)) tracker->TrackFieldWithSize (" in" , in.size ());
555+ tracker->TraitTrackInline (in, " in" );
560556}
561557
562558MaybeLocal<Value> HashTraits::EncodeOutput (Environment* env,
@@ -572,8 +568,6 @@ Maybe<void> HashTraits::AdditionalConfig(
572568 HashConfig* params) {
573569 Environment* env = Environment::GetCurrent (args);
574570
575- params->mode = mode;
576-
577571 CHECK (args[offset]->IsString ()); // Hash algorithm
578572 Utf8Value digest (env->isolate (), args[offset]);
579573 params->digest = ncrypto::getDigestByName (*digest);
@@ -802,8 +796,7 @@ bool DigestUpdateBytepad(ncrypto::EVPMDCtxPointer* ctx,
802796} // namespace
803797
804798CShakeConfig::CShakeConfig (CShakeConfig&& other) noexcept
805- : mode(other.mode),
806- in(std::move(other.in)),
799+ : in(std::move(other.in)),
807800 function_name(std::move(other.function_name)),
808801 customization(std::move(other.customization)),
809802 variant(other.variant),
@@ -816,12 +809,9 @@ CShakeConfig& CShakeConfig::operator=(CShakeConfig&& other) noexcept {
816809}
817810
818811void CShakeConfig::MemoryInfo (MemoryTracker* tracker) const {
819- // If the Job is sync, then the CShakeConfig does not own the data.
820- if (IsCryptoJobAsync (mode)) {
821- tracker->TrackFieldWithSize (" in" , in.size ());
822- tracker->TrackFieldWithSize (" function_name" , function_name.size ());
823- tracker->TrackFieldWithSize (" customization" , customization.size ());
824- }
812+ tracker->TraitTrackInline (in, " in" );
813+ tracker->TraitTrackInline (function_name, " function_name" );
814+ tracker->TraitTrackInline (customization, " customization" );
825815}
826816
827817MaybeLocal<Value> CShakeTraits::EncodeOutput (Environment* env,
@@ -837,8 +827,6 @@ Maybe<void> CShakeTraits::AdditionalConfig(
837827 CShakeConfig* params) {
838828 Environment* env = Environment::GetCurrent (args);
839829
840- params->mode = mode;
841-
842830 CHECK (args[offset]->IsString ()); // Algorithm name
843831 Utf8Value algorithm_name (env->isolate (), args[offset]);
844832 std::string_view algorithm_str = algorithm_name.ToStringView ();
0 commit comments