|
Authored by: pcrooker on Tuesday, May 22 2012 @ 08:32 PM EDT |
They both reference something, pointers a memory location, variables an
abstracted reference.[ Reply to This | Parent | # ]
|
|
Authored by: sdm on Tuesday, May 22 2012 @ 11:00 PM EDT |
Seems to me that one of the defining differences is that you can directly do
math on a numeric reference (an index in my world) which will result in a
pointer (another number) to something.
numeric_reference = 2
Base_address = 1000
(numeric_reference*4)+Base_address = the location of the third 4 byte big entry
in a list that starts at Base_address or 1004.
I don't see how you can do math on a symbolic reference without resolving it to
a numeric reference.
symbolic_reference = w
Base_address = 1000
(symbolic_reference*4)+Base_address = ? ; can't be done
So there difference between them is that resolution of the numeric reference is
not required and so it runs faster.
That bit about the number 2 can also be a symbolic reference put forth by Dr.
Mitchell, while true technically, in practice probably wouldn't work because the
compiler/assembler wouldn't accept a symbolic reference that starts with a
number since doesn't know whether to resolve it or not. Maybe Java does; I don't
know. Besides, if it could be symbolic than 2=3 is a possibly acceptable
statement and that just looks bad :)
The downside with Android is that when something changes, you must resolve those
references in the bytecode to make sure that they will ultimately point (once
the math is done) to the correct places in the rest of the code. Android does
this by parsing the programs bytecode using dexopt as I understand. After dexopt
does its work, the program will again work.
Hmm. I suppose a difference between the two approaches is pretty clear if you
try to run an Android program after changing a library but before dexopt is
applied. I would expect it to crash and burn. The java version of the same
program would still run because it resolves things as it runs or in other words,
dynamically. The Android version requires that dexopt be applied to it before it
will run.
I know this is a pretty trivial example but I think it is in keeping with the
trivial nature of what this lawsuit is all about.
SDM
[ Reply to This | Parent | # ]
|
|
|
|
|