MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / code_size

Method code_size

lib/asmjit/asmjit/core/codeholder.cpp:1123–1142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1121}
1122
1123size_t CodeHolder::code_size() const noexcept {
1124 Support::FastUInt8 of = 0;
1125 uint64_t offset = 0;
1126
1127 for (Section* section : _sections_by_order) {
1128 uint64_t real_size = section->real_size();
1129
1130 if (real_size) {
1131 uint64_t aligned_offset = Support::align_up(offset, section->alignment());
1132 ASMJIT_ASSERT(aligned_offset >= offset);
1133 offset = Support::add_overflow(aligned_offset, real_size, &of);
1134 }
1135 }
1136
1137 if ((sizeof(uint64_t) > sizeof(size_t) && offset > uint64_t(SIZE_MAX)) || of) {
1138 return SIZE_MAX;
1139 }
1140
1141 return size_t(offset);
1142}
1143
1144Error CodeHolder::relocate_to_base(uint64_t base_address, RelocationSummary* summary_out) noexcept {
1145 // Make sure `summary_out` pointer is always valid as we want to fill it.

Callers 7

runMethod · 0.80
write_empty_function_atFunction · 0.80
run_archMethod · 0.80
benchFunction · 0.80
_addMethod · 0.80
getBufferSizeMethod · 0.80
getBufferSizeMethod · 0.80

Calls 4

align_upFunction · 0.85
add_overflowFunction · 0.85
real_sizeMethod · 0.80
alignmentMethod · 0.45

Tested by 2

runMethod · 0.64
write_empty_function_atFunction · 0.64