Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1012266 - printObjectLayout

JavaX fragment (include)

static void printObjectLayout(O o) {
  if (o instanceof Class) o = nu((Class) o);
  print("Size of object " + className(o) + ": " + unsafe_sizeOf(o) + " bytes");
  for (Pair<S, Long> p : mapPairs(unsafe_allFieldOffsets(o)))
    print("  Field " + p.a + " is at offset " + p.b);
  print();
}

download  show line numbers  debug dex   

Travelled to 10 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz, whxojlpjdney

No comments. add comment

Snippet ID: #1012266
Snippet name: printObjectLayout
Eternal ID of this version: #1012266/5
Text MD5: 859fc9acf90c16f7e2b1c9575dd08deb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-28 12:32:57
Source code size: 296 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 220 / 208
Version history: 4 change(s)
Referenced in: #1006654 #1012316

Formerly at http://tinybrain.de/1012266 & http://1012266.tinybrain.de