RelocInfo.cs 959 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. namespace ARMeilleure.CodeGen.Linking
  3. {
  4. /// <summary>
  5. /// Represents relocation information about a <see cref="CompiledFunction"/>.
  6. /// </summary>
  7. readonly struct RelocInfo
  8. {
  9. /// <summary>
  10. /// Gets an empty <see cref="RelocInfo"/>.
  11. /// </summary>
  12. public static RelocInfo Empty { get; } = new RelocInfo(null);
  13. private readonly RelocEntry[] _entries;
  14. /// <summary>
  15. /// Gets the set of <see cref="RelocEntry"/>.
  16. /// </summary>
  17. public ReadOnlySpan<RelocEntry> Entries => _entries;
  18. /// <summary>
  19. /// Initializes a new instance of the <see cref="RelocInfo"/> struct with the specified set of
  20. /// <see cref="RelocEntry"/>.
  21. /// </summary>
  22. /// <param name="entries">Set of <see cref="RelocInfo"/> to use</param>
  23. public RelocInfo(RelocEntry[] entries)
  24. {
  25. _entries = entries;
  26. }
  27. }
  28. }