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

7
LINES

< > BotCompany Repo | #1012266 - printObjectLayout

JavaX fragment (include)

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

download  show line numbers  debug dex   

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

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: 234 / 228
Version history: 4 change(s)
Referenced in: [show references]

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