Jump to content




does tostring on tables and functions give a hash or a memory address

lua

  • You cannot reply to this topic
7 replies to this topic

#1 Pharap

  • Members
  • 816 posts
  • LocationEngland

Posted 04 November 2012 - 04:59 AM

When one uses the tostring function on a table or function, does the hexadecimal code that follows 'table: ' or 'function: ' represent the memory address of the table/function, or is it merely a hash?

#2 kazagistar

  • Members
  • 365 posts

Posted 04 November 2012 - 07:37 AM

If it is a memory location, it is merely an implementation detail. The number is only a unique ID according to the spec.

Why are you curious about this?

#3 Pharap

  • Members
  • 816 posts
  • LocationEngland

Posted 04 November 2012 - 02:10 PM

Just wondering out of interest, it would be useful to know for a project I'm working on.

#4 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 04 November 2012 - 02:18 PM

you mean using cheat engine, right? :D/>

#5 Pharap

  • Members
  • 816 posts
  • LocationEngland

Posted 04 November 2012 - 02:56 PM

I have no clue what that would even be.

#6 kazagistar

  • Members
  • 365 posts

Posted 05 November 2012 - 07:25 AM

I know it is the memory location in the standard C implementation of Lua, but I dunno about JLua... it runs on the JVM, which could seriously obscure some lower level stuff like that.

#7 Pharap

  • Members
  • 816 posts
  • LocationEngland

Posted 05 November 2012 - 11:35 AM

I would assume it's the same, but Java likes to be different from the C-likes, so it's always possible it's something else.

#8 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 06 November 2012 - 12:17 AM

Best way to find out is to look at the LuaJ Docs/Code.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users