main.cpp 739 Bytes
Newer Older
1
// Headers are available because we added the pls target
2 3 4 5
#include <iostream>
#include <functional>
#include <array>
#include <atomic>
6
#include <memory>
7 8

#include <pls/pls.h>
9
#include <pls/internal/helpers/prohibit_new.h>
10
#include <pls/internal/scheduling/thread_state.h>
11 12 13

using namespace pls;

14
int main() {
15 16
    using aligned_state = std::aligned_storage<sizeof(internal::scheduling::thread_state), 64>::type;
    aligned_state data;
17

18 19 20
    std::cout << sizeof(aligned_state) << std::endl;
    malloc_scheduler_memory sched_memory{8};
    std::cout << (std::uintptr_t)sched_memory.thread_for(0) % 64 << ", " << (std::uintptr_t)sched_memory.thread_for(1) % 64 << ", " << (std::uintptr_t)sched_memory.thread_for(2) % 64 << ", " << std::endl;
21
}