@@ -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
@@ -524,10 +524,7 @@ void Hash::HashDigest(const FunctionCallbackInfo<Value>& args) {
524524}
525525
526526HashConfig::HashConfig (HashConfig&& other) noexcept
527- : mode(other.mode),
528- in (std::move(other.in)),
529- digest(other.digest),
530- length(other.length) {}
527+ : in(std::move(other.in)), digest(other.digest), length(other.length) {}
531528
532529HashConfig& HashConfig::operator =(HashConfig&& other) noexcept {
533530 if (&other == this ) return *this ;
@@ -536,8 +533,7 @@ HashConfig& HashConfig::operator=(HashConfig&& other) noexcept {
536533}
537534
538535void HashConfig::MemoryInfo (MemoryTracker* tracker) const {
539- // If the Job is sync, then the HashConfig does not own the data.
540- if (IsCryptoJobAsync (mode)) tracker->TrackFieldWithSize (" in" , in.size ());
536+ tracker->TraitTrackInline (in, " in" );
541537}
542538
543539MaybeLocal<Value> HashTraits::EncodeOutput (Environment* env,
@@ -553,8 +549,6 @@ Maybe<void> HashTraits::AdditionalConfig(
553549 HashConfig* params) {
554550 Environment* env = Environment::GetCurrent (args);
555551
556- params->mode = mode;
557-
558552 CHECK (args[offset]->IsString ()); // Hash algorithm
559553 Utf8Value digest (env->isolate (), args[offset]);
560554 params->digest = ncrypto::getDigestByName (*digest);
@@ -782,8 +776,7 @@ bool DigestUpdateBytepad(ncrypto::EVPMDCtxPointer* ctx,
782776} // namespace
783777
784778CShakeConfig::CShakeConfig (CShakeConfig&& other) noexcept
785- : mode(other.mode),
786- in(std::move(other.in)),
779+ : in(std::move(other.in)),
787780 function_name(std::move(other.function_name)),
788781 customization(std::move(other.customization)),
789782 variant(other.variant),
@@ -796,12 +789,9 @@ CShakeConfig& CShakeConfig::operator=(CShakeConfig&& other) noexcept {
796789}
797790
798791void CShakeConfig::MemoryInfo (MemoryTracker* tracker) const {
799- // If the Job is sync, then the CShakeConfig does not own the data.
800- if (IsCryptoJobAsync (mode)) {
801- tracker->TrackFieldWithSize (" in" , in.size ());
802- tracker->TrackFieldWithSize (" function_name" , function_name.size ());
803- tracker->TrackFieldWithSize (" customization" , customization.size ());
804- }
792+ tracker->TraitTrackInline (in, " in" );
793+ tracker->TraitTrackInline (function_name, " function_name" );
794+ tracker->TraitTrackInline (customization, " customization" );
805795}
806796
807797MaybeLocal<Value> CShakeTraits::EncodeOutput (Environment* env,
@@ -817,8 +807,6 @@ Maybe<void> CShakeTraits::AdditionalConfig(
817807 CShakeConfig* params) {
818808 Environment* env = Environment::GetCurrent (args);
819809
820- params->mode = mode;
821-
822810 CHECK (args[offset]->IsString ()); // Algorithm name
823811 Utf8Value algorithm_name (env->isolate (), args[offset]);
824812 std::string_view algorithm_str = algorithm_name.ToStringView ();
0 commit comments