Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-macho-2.5.1/lib/macho/macho_file.rb
# The segment alignment for the Mach-O. Guesses conservatively.
# @return [Integer] the alignment, as a power of 2
# @note This is **not** the same as {#alignment}!
# @note See `get_align` and `get_align_64` in `cctools/misc/lipo.c`
The segment alignment for the Mach-O. Guesses conservatively.
The segment alignment for the Mach - O . Guesses conservatively .
def segment_alignment
      return 12 if %i[i386 x86_64 ppc ppc64].include?(cputype)
      return 14 if %i[arm arm64].include?(cputype)
      cur_align = Sections::MAX_SECT_ALIGN
      segments.each do |segment|
        if filetype == :object
          align = magic32? ? 2 : 3
          segment.sections.each do |section|
            align = section.align unless section.align <= align
          end
        else
          align = segment.guess_align
        end
        cur_align = align if align < cur_align
      end
      cur_align
    end
def segment_alignment return 12 if %i[ i386 x86_64 ppc ppc64 ] . include? ( cputype ) return 14 if %i[ arm arm64 ] . include? ( cputype ) cur_align = Sections :: MAX_SECT_ALIGN segments . each do | segment | if filetype == :object align = magic32? ? 2 : 3 segment . sections . each do | section | align = section . align unless section . align <= align end else align = segment . guess_align end cur_align = align if align < cur_align end cur_align end
The segment alignment for the Mach-O.
The segment alignment for the Mach - O .
# special cases: 12 for x86/64/PPC/PP64, 14 for ARM/ARM64 # start with the smallest alignment, and work our way up
the alignment, as a power of 2
the alignment as a power of 2
Integer
note
This is **not** the same as {#alignment}!
This is ** not ** the same as { #alignment } !
note
See `get_align` and `get_align_64` in `cctools/misc/lipo.c`
See ` get_align ` and ` get_align_64 ` in ` cctools / misc / lipo . c `