JavaScript 变量内存位置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19333920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JavaScript variables memory location
提问by onetwo12
Is there a way to see where the variable is located in the memory?
有没有办法查看变量在内存中的位置?
In ActionScript for example in debug mode you can see the memory location of the variable
例如在调试模式下的 ActionScript 中,您可以看到变量的内存位置
I am using Google Chrome developer tools where I can see the variables in debug mode but there is no info about the memory location of the variable.
我正在使用 Google Chrome 开发人员工具,我可以在调试模式下查看变量,但没有关于变量内存位置的信息。
Are there any browser tools that show variable memory location?
是否有任何浏览器工具可以显示可变内存位置?
回答by Bergi
Take a memory snapshot. This will show in detail what kind of objects are floating around, where and how many they are.
拍摄内存快照。这将详细显示周围漂浮的物体种类、位置和数量。
Of course, it won't show you the exact memory or register addresses, but you hardly will need those for debugging javascript.
当然,它不会向您显示确切的内存或寄存器地址,但您几乎不需要这些来调试 javascript。
回答by Karol Sikora
No, it isn't possible. Due to way javascript interpretes works, it is quite hard to get memory address.
不,这不可能。由于 javascript 解释的方式,很难获得内存地址。