object.c
/*
 *  reserveStorage - ensure that highest parcel address is not less than the origin counter
 */
ensure that highest parcel address is not less than the origin counter
ensure that highest parcel address is not less than the origin counter
void reserveStorage(Section *section, u32 firstAddress, u32 count) {
    u32 addr;
    ObjectBlock *block;
    u32 lastAddress;
    if (pass == 1 || count < 1) return;
    lastAddress = firstAddress + count - 1;
    addr = lastAddress * 2;
    block = section->objectBlock;
    while (addr + 1 >= block->imageSize) {
        if (block->image == NULL) block->lowestParcelAddress = firstAddress;
        block->image = (u8 *)reallocate(block->image, block->imageSize, block->imageSize + IMAGE_INCREMENT);
        block->imageSize += IMAGE_INCREMENT;
    }
    if (firstAddress < block->lowestParcelAddress) block->lowestParcelAddress = firstAddress;
    if (lastAddress > block->highestParcelAddress) block->highestParcelAddress = lastAddress;
}
void reserveStorage ( Section * section , u32 firstAddress , u32 count ) { u32 addr ; ObjectBlock * block ; u32 lastAddress ; if ( pass == 1 || count < 1 ) return ; lastAddress = firstAddress + count - 1 ; addr = lastAddress * 2 ; block = section -> objectBlock ; while ( addr + 1 >= block -> imageSize ) { if ( block -> image == NULL ) block -> lowestParcelAddress = firstAddress ; block -> image = ( u8 * ) reallocate ( block -> image , block -> imageSize , block -> imageSize + IMAGE_INCREMENT ) ; block -> imageSize += IMAGE_INCREMENT ; } if ( firstAddress < block -> lowestParcelAddress ) block -> lowestParcelAddress = firstAddress ; if ( lastAddress > block -> highestParcelAddress ) block -> highestParcelAddress = lastAddress ; }
reserveStorage - ensure that highest parcel address is not less than the origin counter
reserveStorage - ensure that highest parcel address is not less than the origin counter