I would like to print the current memory address of a variable in Dart but I don't know if this is possible. I want to write a code to show all memory address in a liked list structure.
Advice are welcome.
User and Flutter EventExpand the events at the bottom of the hover card to display all events for that timestamp. Displayed below the events pane is the memory chart and the Android memory chart. The android-memory chart is specific to an Android app, and it shows Android ADB meminfo from an ADB app summary.
There is no way to print the memory address of a variable in Dart.
Even if you could print the memory address, there is nothing meaningful that you could do with it.
If you want to identify objects, you could use identityHashCode
.
It's not possible to access raw memory of Dart objects. Dart is a garbage collected language which means that Dart objects are not guaranteed to live at a particular memory address as the garbage collector can (and certainly will) move these objects to different memory locations during a garbage collection. Within the Dart virtual machine Dart objects are almost exclusively accessed and passed around via handles and not raw pointers for this very reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With