Skip to content

Instantly share code, notes, and snippets.

@chrisvest
Created December 1, 2014 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvest/6ffeb1c88100fea39339 to your computer and use it in GitHub Desktop.
Save chrisvest/6ffeb1c88100fea39339 to your computer and use it in GitHub Desktop.
public static void main(String[] args) {
MemoryHolder holder = new MemoryHolder();
long p = holder.pointer; // last use of 'holder'
int n = unsafe.getInt(null, p);
System.out.println("holder.getInt() = " + n);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment