- Timestamp:
- Sep 14, 2009 12:44:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r22919 r22997 58 58 #include "REMInternal.h" 59 59 #include <VBox/vm.h> 60 #include <VBox/uvm.h> 60 61 #include <VBox/param.h> 61 62 #include <VBox/x86.h> … … 107 108 rc++; \ 108 109 } \ 110 } while (0) 111 112 #define CHECK_PADDING_UVM(align, member) \ 113 do \ 114 { \ 115 CHECK_PADDING(UVM, member, align); \ 116 CHECK_MEMBER_ALIGNMENT(UVM, member, align); \ 117 UVM *p; \ 118 if (sizeof(p->member.padding) >= (ssize_t)sizeof(p->member.s) + 128 + sizeof(p->member.s) / 20) \ 119 printf("warning: UVM::%-8s: padding=%-5d s=%-5d -> %-4d suggest=%-5u\n", \ 120 #member, (int)sizeof(p->member.padding), (int)sizeof(p->member.s), \ 121 (int)sizeof(p->member.padding) - (int)sizeof(p->member.s), \ 122 (int)RT_ALIGN_Z(sizeof(p->member.s), (align))); \ 123 } while (0) 124 125 #define CHECK_PADDING_UVMCPU(align, member) \ 126 do \ 127 { \ 128 CHECK_PADDING(UVMCPU, member, align); \ 129 CHECK_MEMBER_ALIGNMENT(UVMCPU, member, align); \ 130 UVMCPU *p; \ 131 if (sizeof(p->member.padding) >= (ssize_t)sizeof(p->member.s) + 128 + sizeof(p->member.s) / 20) \ 132 printf("warning: UVMCPU::%-8s: padding=%-5d s=%-5d -> %-4d suggest=%-5u\n", \ 133 #member, (int)sizeof(p->member.padding), (int)sizeof(p->member.s), \ 134 (int)sizeof(p->member.padding) - (int)sizeof(p->member.s), \ 135 (int)RT_ALIGN_Z(sizeof(p->member.s), (align))); \ 109 136 } while (0) 110 137 … … 355 382 } 356 383 384 printf("struct UVM: %d bytes\n", (int)sizeof(UVM)); 385 386 CHECK_PADDING_UVM(32, vm); 387 CHECK_PADDING_UVM(32, mm); 388 CHECK_PADDING_UVM(32, pdm); 389 CHECK_PADDING_UVM(32, stam); 390 CHECK_PADDING_UVMCPU(32, vm); 391 357 392 /* 358 393 * Compare HC and GC.
Note:
See TracChangeset
for help on using the changeset viewer.