Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions kernel/core/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ static bool actor_pool_used[MAX_ACTORS];
static message_t message_pool[MAX_MESSAGES];
static bool message_pool_used[MAX_MESSAGES];

// Internal function prototypes
static struct actor_context* scheduler_select_next_actor(void);
static void scheduler_context_switch(struct actor_context* next_actor);
static void scheduler_add_to_ready_queue(struct actor_context* actor);
static void scheduler_remove_from_ready_queue(struct actor_context* actor);
static void actor_create_kernel_actor(void);
static bool actor_add_message(struct actor_context* actor, message_t* message);
static void actor_clear_message_queue(struct actor_context* actor);
Copy link

Copilot AI Aug 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function prototype for message_allocate should include a parameter to indicate if allocation failed, or the function should be documented to clarify error handling behavior. Consider adding a comment about how allocation failure is handled.

Suggested change
static void actor_clear_message_queue(struct actor_context* actor);
static void actor_clear_message_queue(struct actor_context* actor);
// Allocates a message from the pool. Returns NULL if allocation fails; caller must check for NULL.

Copilot uses AI. Check for mistakes.
static message_t* message_allocate(void);

// =============================================================================
// Core Scheduler Functions
// =============================================================================
Expand Down
4 changes: 2 additions & 2 deletions kernel/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ typedef struct {
// Async Actor System Definitions (Forward Declaration)
// =============================================================================

// Forward declarations - actual definitions in scheduler.h
typedef struct actor_context actor_t;
// Forward declaration - actual definition in scheduler.h
struct actor_context;

// =============================================================================
// Memory Management Definitions
Expand Down
Loading