notes.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #if !Rar2017_64bit
  2. using nint = System.Int32;
  3. using nuint = System.UInt32;
  4. using size_t = System.UInt32;
  5. #else
  6. using nint = System.Int64;
  7. using nuint = System.UInt64;
  8. using size_t = System.UInt64;
  9. #endif
  10. using int64 = System.Int64;
  11. notes on C->C# primitive mappings:
  12. nint := native integer
  13. nuint := native unsigned integer
  14. type 32b 64b mapping CAREFUL!
  15. char 8 bit 8 bit short
  16. unsigned char 8 bit 8 bit ushort
  17. short int 16 bit 16 bit short
  18. short int 16 bit 16 bit short
  19. unsigned short int 16 bit 16 bit ushort
  20. int 32 bit 32 bit int
  21. unsigned int 32 bit 32 bit uint
  22. long int 32 bit 64 bit nint ***
  23. unsigned long int 32 bit 64 bit nuint ***
  24. long long int 64 bit 64 bit long
  25. unsigned long long int 64 bit 64 bit ulong
  26. size_t 32 bit 64 bit nuint
  27. The size_t type is the unsigned integer type that is the result of the sizeof operator (and the offsetof operator),
  28. so it is guaranteed to be big enough to contain the size of the biggest object your system can handle (e.g., a static array of 8Gb).
  29. [size_t] -> ulong (x64)
  30. [size_t] -> uint (x86)
  31. size_t is an unsigned data type defined by several C/C++ standards, e.g. the C99 ISO/IEC 9899 standard, that is defined
  32. in stddef.h.1 It can be further imported by inclusion of stdlib.h as this file internally sub includes stddef.h.
  33. This type is used to represent the size of an object. Library functions that take or return sizes expect them to be of type or
  34. have the return type of size_t. Further, the most frequently used compiler-based operator sizeof should evaluate to a constant
  35. value that is compatible with size_t.
  36. 20171218
  37. urggh, this allows things like new int[int.MaxValue] but NOT new byte[uint.MaxValue]
  38. currently arrays are limited to being indexed by an int hence int.MaxValue entries. weak.
  39. To get arrays > 2GB on x64 we need to configure
  40. <gcAllowVeryLargeObjects enabled="true"/>
  41. https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element