main.cpp 999 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
    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;
17 18
    std::cout << (std::uintptr_t)sched_memory.thread_state_for(0) % 64 << ", " << (std::uintptr_t)sched_memory.thread_state_for(1) % 64 << ", " << (std::uintptr_t)sched_memory.thread_state_for(2) % 64 << ", " << std::endl;
    std::cout << (std::uintptr_t)sched_memory.task_stack_for(0) % 64 << ", " << (std::uintptr_t)sched_memory.task_stack_for(1) % 64 << ", " << (std::uintptr_t)sched_memory.task_stack_for(2) % 64 << ", " << std::endl;
19
}