[rtems commit] PR2069: [CBS Scheduler] Memory leak and enqueue problem

Gedare Bloom gedare at rtems.org
Mon Aug 6 17:48:20 UTC 2012


Module:    rtems
Branch:    master
Commit:    7a9288fe3524236c18ad64b73ce5fa0c6da484b0
Changeset: http://git.rtems.org/rtems/commit/?id=7a9288fe3524236c18ad64b73ce5fa0c6da484b0

Author:    Andreas Heinig <andreas.heinig at cs.tu-dortmund.de>
Date:      Mon Aug  6 13:46:27 2012 -0400

PR2069: [CBS Scheduler] Memory leak and enqueue problem

 Due to the fact that CBS extends the EDF scheduler, most parts of EDF are
 reused. One part is the allocation of the per-thread data. However, the CBS
 per-thread structure defines a further element (while including the rest of
 Scheduler_EDF_Per_thread)

---

 cpukit/score/Makefile.am                        |    1 +
 cpukit/score/include/rtems/score/schedulercbs.h |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index cb512e4..6f9f94f 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -238,6 +238,7 @@ libscore_a_SOURCES += src/scheduleredf.c \
 
 ## SCHEDULERCBS_C_FILES
 libscore_a_SOURCES += src/schedulercbs.c \
+    src/schedulercbsallocate.c \
     src/schedulercbsattachthread.c \
     src/schedulercbscleanup.c \
     src/schedulercbscreateserver.c \
diff --git a/cpukit/score/include/rtems/score/schedulercbs.h b/cpukit/score/include/rtems/score/schedulercbs.h
index 7f49321..6aa986d 100644
--- a/cpukit/score/include/rtems/score/schedulercbs.h
+++ b/cpukit/score/include/rtems/score/schedulercbs.h
@@ -49,7 +49,7 @@ extern "C" {
     _Scheduler_EDF_Yield,            /* yield entry point */ \
     _Scheduler_EDF_Block,            /* block entry point */ \
     _Scheduler_CBS_Unblock,          /* unblock entry point */ \
-    _Scheduler_EDF_Allocate,         /* allocate entry point */ \
+    _Scheduler_CBS_Allocate,         /* allocate entry point */ \
     _Scheduler_EDF_Free,             /* free entry point */ \
     _Scheduler_EDF_Update,           /* update entry point */ \
     _Scheduler_EDF_Enqueue,          /* enqueue entry point */ \
@@ -315,6 +315,17 @@ void _Scheduler_CBS_Budget_callout(
   Thread_Control *the_thread
 );
 
+/**
+ *  @brief Scheduler CBS Allocate
+ *
+ *  This routine allocates CBS specific information of @a the_thread.
+ *
+ *  @param[in] the_thread is the thread the scheduler is allocating
+ *             management memory for.
+ */
+void *_Scheduler_CBS_Allocate(
+  Thread_Control      *the_thread
+);
 #ifdef __cplusplus
 }
 #endif




More information about the vc mailing list