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

Code before:
    /// </summary>
    /// <param name="ptr">The address of the cache line to be loaded. This address is not required to be on a cache line boundary.</param>
    static void Prefetch(void const* ptr) = delete;

#if COMPILE_WITH_PROFILER
    static void TrackAllocation(uint64 size);
#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>

Review comment (suggestion):
There is already API to get page size on system: `Platform::GetCPUInfo().PageSize` so we can skip that one.

Code after:
    /// </summary>
    /// <param name="ptr">The address of the cache line to be loaded. This address is not required to be on a cache line boundary.</param>
    static void Prefetch(void const* ptr) = delete;

#if COMPILE_WITH_PROFILER
    static void TrackAllocation(uint64 size);
#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>