Microsoft.Cci.MetadataHostEnvironment.GetTargetPlatformPointerSize C# (CSharp) Method

GetTargetPlatformPointerSize() protected method

Returns an opinion about the size of a pointer on the target runtime for the set of modules currently in this.unitCache. If none of the modules requires either 32 bit pointers or 64 bit pointers the result is 4 (i.e. 32 bit pointers). This method is only called if a host application has not explicitly provided the pointer size of the target platform.
protected GetTargetPlatformPointerSize ( ) : byte
return byte
    protected virtual byte GetTargetPlatformPointerSize() {
      Contract.Ensures(Contract.Result<byte>() == 4 || Contract.Result<byte>() == 8);
      lock (GlobalLock.LockingObject) {
        if (this.unitCache.Count > 0) {
          foreach (IUnit unit in this.unitCache.Values) {
            IModule/*?*/ module = unit as IModule;
            if (module == null) continue;
            if (module.Requires32bits) return 4;
            if (module.Requires64bits) return 8;
          }
        }
      }
      return 4;
    }