MCPcopy Create free account
hub / github.com/ZDoom/Raze / newRelocEntry

Method newRelocEntry

libraries/asmjit/asmjit/base/codeholder.cpp:538–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538Error CodeHolder::newRelocEntry(RelocEntry** dst, uint32_t type, uint32_t size) noexcept {
539 ASMJIT_PROPAGATE(_relocations.willGrow(&_baseHeap));
540
541 size_t index = _relocations.getLength();
542 if (ASMJIT_UNLIKELY(index > size_t(0xFFFFFFFFU)))
543 return DebugUtils::errored(kErrorRelocIndexOverflow);
544
545 RelocEntry* re = _baseHeap.allocZeroedT<RelocEntry>();
546 if (ASMJIT_UNLIKELY(!re))
547 return DebugUtils::errored(kErrorNoHeapMemory);
548
549 re->_id = static_cast<uint32_t>(index);
550 re->_type = static_cast<uint8_t>(type);
551 re->_size = static_cast<uint8_t>(size);
552 re->_sourceSectionId = SectionEntry::kInvalidId;
553 re->_targetSectionId = SectionEntry::kInvalidId;
554 _relocations.appendUnsafe(re);
555
556 *dst = re;
557 return kErrorOk;
558}
559
560// TODO: Support multiple sections, this only relocates the first.
561// TODO: This should go to Runtime as it's responsible for relocating the

Callers 2

embedLabelMethod · 0.80
_emitMethod · 0.80

Calls 4

erroredFunction · 0.85
willGrowMethod · 0.80
appendUnsafeMethod · 0.80
getLengthMethod · 0.45

Tested by

no test coverage detected