BluFedora Job System v1.0.0
This is a C++ job system library for use in game engines.
Job::JobSystemMemoryRequirements Struct Reference

The memory requirements for a given configuration JobSystemCreateOptions. More...

#include <job_api.hpp>

Public Member Functions

 JobSystemMemoryRequirements (const JobSystemCreateOptions &options={}) noexcept
 

Public Attributes

const JobSystemCreateOptions options
 The options used to create the memory requirements. More...
 
std::size_t byte_size
 The number of bytes the job system needed. More...
 
std::size_t alignment
 The base alignment the pointer should be. More...
 

Detailed Description

The memory requirements for a given configuration JobSystemCreateOptions.

Definition at line 99 of file job_api.hpp.

Constructor & Destructor Documentation

◆ JobSystemMemoryRequirements()

Job::JobSystemMemoryRequirements::JobSystemMemoryRequirements ( const JobSystemCreateOptions options = {})
noexcept

Definition at line 720 of file job_system.cpp.

720 :
722 byte_size{0},
723 alignment{0}
724{
725 JobAssert(IsPowerOf2(options.main_queue_size), "Main queue size must be a power of two.");
726 JobAssert(IsPowerOf2(options.normal_queue_size), "Normal queue size must be a power of two.");
727 JobAssert(IsPowerOf2(options.worker_queue_size), "Worker queue size must be a power of two.");
728
729 const WorkerID num_threads = config::WorkerCount(options);
730 const std::uint16_t num_tasks_per_worker = config::NumTasksPerWorker(options);
731 const std::uint32_t total_num_tasks = config::TotalNumTasks(num_threads, num_tasks_per_worker);
732
733 MemoryRequirementsPush<JobSystemContext>(this, 1u);
734 MemoryRequirementsPush<ThreadLocalState>(this, num_threads);
735 MemoryRequirementsPush<TaskMemoryBlock>(this, total_num_tasks);
736 MemoryRequirementsPush<TaskPtr>(this, options.main_queue_size);
737 MemoryRequirementsPush<AtomicTaskPtr>(this, total_num_tasks);
738 MemoryRequirementsPush<TaskHandle>(this, total_num_tasks);
739}
#define JobAssert(expr, msg)
Definition: job_assert.hpp:27
std::uint16_t normal_queue_size
Number of tasks in each worker's QueueType::NORMAL queue. (Must be power of two)
Definition: job_api.hpp:90
std::uint16_t main_queue_size
Number of tasks in the job system's QueueType::MAIN queue. (Must be power of two)
Definition: job_api.hpp:89
std::uint16_t WorkerID
The id type of each worker thread.
Definition: job_api.hpp:54
std::uint16_t worker_queue_size
Number of tasks in each worker's QueueType::WORKER queue. (Must be power of two)
Definition: job_api.hpp:91
std::size_t alignment
The base alignment the pointer should be.
Definition: job_api.hpp:103
const JobSystemCreateOptions options
The options used to create the memory requirements.
Definition: job_api.hpp:101
std::size_t byte_size
The number of bytes the job system needed.
Definition: job_api.hpp:102

Member Data Documentation

◆ options

const JobSystemCreateOptions Job::JobSystemMemoryRequirements::options

The options used to create the memory requirements.

Definition at line 101 of file job_api.hpp.

◆ byte_size

std::size_t Job::JobSystemMemoryRequirements::byte_size

The number of bytes the job system needed.

Definition at line 102 of file job_api.hpp.

◆ alignment

std::size_t Job::JobSystemMemoryRequirements::alignment

The base alignment the pointer should be.

Definition at line 103 of file job_api.hpp.


The documentation for this struct was generated from the following files: