File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -2176,10 +2176,9 @@ namespace jsoncons {
21762176 // Get array internal storage
21772177 const array& arr = current->template cast <array_storage>().value ();
21782178
2179- // Memory for the array object itself
2180- mem_size += sizeof (array);
2181-
21822179 // Memory for the array's internal buffer
2180+ // Note: We only count dynamically allocated memory (heap).
2181+ // The array object itself is part of array_storage allocation.
21832182 if (!arr.empty ())
21842183 {
21852184 // Get pointer to internal vector buffer
@@ -2201,10 +2200,9 @@ namespace jsoncons {
22012200 // Get object internal storage
22022201 const object& obj = current->template cast <object_storage>().value ();
22032202
2204- // Memory for the object itself
2205- mem_size += sizeof (object);
2206-
22072203 // Memory for the object's internal storage (vector of key_value_type)
2204+ // Note: We only count dynamically allocated memory (heap).
2205+ // The object itself is part of object_storage allocation.
22082206 if (!obj.empty ())
22092207 {
22102208 // Get pointer to internal vector buffer via iterator
You can’t perform that action at this time.
0 commit comments