@@ -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
@@ -528,10 +528,7 @@ void Hash::HashDigest(const FunctionCallbackInfo<Value>& args) {
528528}
529529
530530HashConfig::HashConfig (HashConfig&& other) noexcept
531- : mode(other.mode),
532- in (std::move(other.in)),
533- digest(other.digest),
534- length(other.length) {}
531+ : in(std::move(other.in)), digest(other.digest), length(other.length) {}
535532
536533HashConfig& HashConfig::operator =(HashConfig&& other) noexcept {
537534 if (&other == this ) return *this ;
@@ -540,8 +537,7 @@ HashConfig& HashConfig::operator=(HashConfig&& other) noexcept {
540537}
541538
542539void HashConfig::MemoryInfo (MemoryTracker* tracker) const {
543- // If the Job is sync, then the HashConfig does not own the data.
544- if (IsCryptoJobAsync (mode)) tracker->TrackFieldWithSize (" in" , in.size ());
540+ tracker->TraitTrackInline (in, " in" );
545541}
546542
547543MaybeLocal<Value> HashTraits::EncodeOutput (Environment* env,
@@ -557,8 +553,6 @@ Maybe<void> HashTraits::AdditionalConfig(
557553 HashConfig* params) {
558554 Environment* env = Environment::GetCurrent (args);
559555
560- params->mode = mode;
561-
562556 CHECK (args[offset]->IsString ()); // Hash algorithm
563557 Utf8Value digest (env->isolate (), args[offset]);
564558 params->digest = ncrypto::getDigestByName (*digest);
@@ -787,8 +781,7 @@ bool DigestUpdateBytepad(ncrypto::EVPMDCtxPointer* ctx,
787781} // namespace
788782
789783CShakeConfig::CShakeConfig (CShakeConfig&& other) noexcept
790- : mode(other.mode),
791- in(std::move(other.in)),
784+ : in(std::move(other.in)),
792785 function_name(std::move(other.function_name)),
793786 customization(std::move(other.customization)),
794787 variant(other.variant),
@@ -801,12 +794,9 @@ CShakeConfig& CShakeConfig::operator=(CShakeConfig&& other) noexcept {
801794}
802795
803796void CShakeConfig::MemoryInfo (MemoryTracker* tracker) const {
804- // If the Job is sync, then the CShakeConfig does not own the data.
805- if (IsCryptoJobAsync (mode)) {
806- tracker->TrackFieldWithSize (" in" , in.size ());
807- tracker->TrackFieldWithSize (" function_name" , function_name.size ());
808- tracker->TrackFieldWithSize (" customization" , customization.size ());
809- }
797+ tracker->TraitTrackInline (in, " in" );
798+ tracker->TraitTrackInline (function_name, " function_name" );
799+ tracker->TraitTrackInline (customization, " customization" );
810800}
811801
812802MaybeLocal<Value> CShakeTraits::EncodeOutput (Environment* env,
@@ -822,8 +812,6 @@ Maybe<void> CShakeTraits::AdditionalConfig(
822812 CShakeConfig* params) {
823813 Environment* env = Environment::GetCurrent (args);
824814
825- params->mode = mode;
826-
827815 CHECK (args[offset]->IsString ()); // Algorithm name
828816 Utf8Value algorithm_name (env->isolate (), args[offset]);
829817 std::string_view algorithm_str = algorithm_name.ToStringView ();
0 commit comments