Repository: FlaxEngine/FlaxEngine
File: Source/Engine/Platform/Base/PlatformBase.h (C/C++)

Code before:
#endif

    /// <summary>
    /// Allocates memory on a specified alignment boundary.
    /// </summary>
    /// <param name="size">The size of the allocation (in bytes).</param>
    /// <param name="alignment">The memory alignment (in bytes). Must be an integer power of 2.</param>
    /// <returns>The pointer to the allocated chunk of the memory. The pointer is a multiple of alignment.</returns>
    static void* Allocate(uint64 size, uint64 alignment) = delete;

    /// <summary>
    /// Frees a block of allocated memory.
    /// </summary>
    /// <param name="ptr">A pointer to the memory block to deallocate.</param>
    static void Free(void* ptr) = delete;

    /// <summary>
    /// Returns the OS's default page size that can be used with AllocatePages.
    /// </summary>
    static uint64 GetDefaultPageSize() = delete;

    /// <summary>
    /// Allocates pages memory block.
    /// </summary>
    /// <param name="numPages">The number of pages to allocate.</param>
    /// <param name="pageSize">The size of single page. Use GetDefaultPageSize() or provide compatible, custom size.</param>
    /// <returns>The pointer to the allocated pages in memory.</returns>
    static void* AllocatePages(uint64 numPages, uint64 pageSize) = delete;

    /// <summary>
    /// Frees allocated pages memory block.
    /// </summary>
    /// <param name="ptr">The pointer to the pages to deallocate.</param>
    static void FreePages(void* ptr) = delete;

public:

    /// <summary>
    /// Returns the current runtime platform type. It's compile-time constant.
    /// </summary>
    API_PROPERTY() static PlatformType GetPlatformType();

    /// <summary>
    /// Returns true if is running 64 bit application (otherwise 32 bit). It's compile-time constant.
    /// </summary>
    API_PROPERTY() static bool Is64BitApp();

    /// <summary>
    /// Returns true if running on 64-bit computer
    /// </summary>
    /// <returns>True if running on 64-bit computer, otherwise false.</returns>

Review comment (suggestion):
Update comment to use `Platform::GetCPUInfo().PageSize` as default.

Code after:
#endif

    /// <summary>
    /// Allocates memory on a specified alignment boundary.
    /// </summary>
    /// <param name="size">The size of the allocation (in bytes).</param>
    /// <param name="alignment">The memory alignment (in bytes). Must be an integer power of 2.</param>
    /// <returns>The pointer to the allocated chunk of the memory. The pointer is a multiple of alignment.</returns>
    static void* Allocate(uint64 size, uint64 alignment) = delete;

    /// <summary>
    /// Frees a block of allocated memory.
    /// </summary>
    /// <param name="ptr">A pointer to the memory block to deallocate.</param>
    static void Free(void* ptr) = delete;

    /// <summary>
    /// Allocates pages memory block.
    /// </summary>
    /// <param name="numPages">The number of pages to allocate.</param>
    /// <param name="pageSize">The size of single page. Use Platform::GetCPUInfo().PageSize or provide compatible, custom size.</param>
    /// <returns>The pointer to the allocated pages in memory.</returns>
    static void* AllocatePages(uint64 numPages, uint64 pageSize) = delete;

    /// <summary>
    /// Frees allocated pages memory block.
    /// </summary>
    /// <param name="ptr">The pointer to the pages to deallocate.</param>
    static void FreePages(void* ptr) = delete;

public:

    /// <summary>
    /// Returns the current runtime platform type. It's compile-time constant.
    /// </summary>
    API_PROPERTY() static PlatformType GetPlatformType();

    /// <summary>
    /// Returns true if is running 64 bit application (otherwise 32 bit). It's compile-time constant.
    /// </summary>
    API_PROPERTY() static bool Is64BitApp();

    /// <summary>
    /// Returns true if running on 64-bit computer
    /// </summary>
    /// <returns>True if running on 64-bit computer, otherwise false.</returns>
    API_PROPERTY() static bool Is64BitPlatform() = delete;

    /// <summary>
    /// Gets the CPU information.
    /// </summary>