Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c committed Jul 3, 2023
1 parent e5dbc28 commit f4b358b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ in compliance with [Flutter repo style guide]( https://github.com/flutter/flutte
## Naming for typedefs and function variables

Follow [Flutter repo naming rules for typedefs and function variables](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#naming-rules-for-typedefs-and-function-variables).

## Operator `==` and `hashCode`

Follow (Flutter repo rules for `==` and `hashCode`)[https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#common-boilerplates-for-operator--and-hashcode]
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@ class _JsonFields {
static const String shallowSize = 'shallowSize';
}

class HeapRef {
HeapRef({required this.index, required this.location});

/// Index of the object in [AdaptedHeapData.objects].
final int index;

/// Name of field in class or index in array.
final String? location;

@override
bool operator ==(Object other) {
if (other.runtimeType != runtimeType) {
return false;
}
return other is HeapRef &&
other.index == index &&
other.location == location;
}

@override
int get hashCode => Object.hash(index, location);
}

/// Contains information from [HeapSnapshotObject] needed for
/// memory analysis on memory screen.
class AdaptedHeapObject {
Expand Down

0 comments on commit f4b358b

Please sign in to comment.