Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Os: wrapping low-level allocation #20

Open
kachsheev opened this issue Nov 1, 2024 · 0 comments
Open

Os: wrapping low-level allocation #20

kachsheev opened this issue Nov 1, 2024 · 0 comments

Comments

@kachsheev
Copy link
Member

kachsheev commented Nov 1, 2024

Need to use this API:

  • Windows: VirtualAlloc()/VirtualFree() (see 1, 2)
  • Linux: mmap()/munmap() in anonymous mode (see this)

New files:

  • include/FlameIDE/Os/Allocation.hpp
  • src/Os/Allocation.cpp
  • src/Os/AllocationFunctions.hpp
  • src/Os/Posix/AllocationFunctions.cpp
  • src/Os/Windows/AllocationFunctions.cpp
  • src/Os/Tests/AllocationTest.hpp
  • src/Os/Tests/AllocationTest.cpp

Edit:

  • src/Os/Test/TestAggregator.cpp

Implement as functions:

#include <FlameIDE/Common/Traits/Defaults.hpp>
#include <FlameIDE/Os/Expected.hpp>
#include <FlameIDE/Os/Types.hpp>

namespace flame_ide
{namespace os
{

Expected<VoidTraits::Pointer, Status>
allocate(Types::size_t size) noexcept;

void deallocate(VoidTraits::Pointer pointer, Types::size_t size) noexcept;

}} // namespace flame_ide::os
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant