INNER CODE UNIT · JavaScript

alignmentAdjustment

electronicarts/pbmpm · src/buffer_factory.js:41

        let alignmentAdjustment = this.totalCount % requiredAlignment;        
        while(alignmentAdjustment !== 0)
        {
            // Add a padding element to align up the member to the correct address
            this.add(`padding${this.paddingCount}`, f32);
            this.paddingCount += 1; 
            alignmentAdjustment -= 1;
        }

        this.elements.push({
            name: name,
            type: type,
            value: undefined,
            offset: this.totalCount,
            slotCount: requiredSlotCount
        });

        this.totalCount += requiredSlotCount;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…