21 references to BitArithmetic
System.Reflection.Metadata (21)
System\Reflection\Metadata\BlobBuilder.cs (1)
812
WriteBytes(0,
BitArithmetic
.Align(position, alignment) - position);
System\Reflection\Metadata\BlobWriter.cs (1)
245
WriteBytes(0,
BitArithmetic
.Align(offset, alignment) - offset);
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (2)
616
int alignment =
BitArithmetic
.Align(_blobHeapSize, 4) - _blobHeapSize;
644
target.WriteBytes(0,
BitArithmetic
.Align(length, 4) - length);
System\Reflection\Metadata\Ecma335\MetadataSizes.cs (5)
136
MetadataVersionPaddedLength =
BitArithmetic
.Align(metadataVersionByteCount + 1, 4);
328
size =
BitArithmetic
.Align(size + 1, StreamAlignment);
392
BitArithmetic
.Align(streamName.Length + 1, 4); // zero-terminated name, padding
411
return
BitArithmetic
.Align(HeapSizes[i], StreamAlignment);
443
BitArithmetic
.CountBits(ExternalTablesMask) * sizeof(int); // External row counts
System\Reflection\PortableExecutable\ManagedTextSection.cs (3)
131
result =
BitArithmetic
.Align(result, Is32Bit ? 4 : 8); //optional padding to make startup stub's target address align on word or double word boundary
143
result =
BitArithmetic
.Align(result, MappedFieldDataAlignment);
185
return OffsetToILStream +
BitArithmetic
.Align(ILStreamSize, 4);
System\Reflection\PortableExecutable\PEBuilder.cs (7)
129
var nextRva =
BitArithmetic
.Align(sizeOfPeHeaders, Header.SectionAlignment);
130
var nextPointer =
BitArithmetic
.Align(sizeOfPeHeaders, Header.FileAlignment);
141
sizeOfRawData:
BitArithmetic
.Align(builder.Count, Header.FileAlignment),
146
nextRva =
BitArithmetic
.Align(serialized.RelativeVirtualAddress + serialized.VirtualSize, Header.SectionAlignment);
272
builder.WriteUInt32((uint)
BitArithmetic
.Align(lastSection.RelativeVirtualAddress + lastSection.VirtualSize, Header.SectionAlignment));
275
builder.WriteUInt32((uint)
BitArithmetic
.Align(Header.ComputeSizeOfPEHeaders(sections.Length), Header.FileAlignment));
433
int remainingHeader =
BitArithmetic
.Align(peHeadersSize, peHeaderAlignment);
System\Reflection\PortableExecutable\PEHeaderBuilder.cs (2)
67
if (fileAlignment < 512 || fileAlignment > 64 * 1024 ||
BitArithmetic
.CountBits(fileAlignment) != 1)
72
if (sectionAlignment < fileAlignment ||
BitArithmetic
.CountBits(sectionAlignment) != 1)