[PATCH] capture: change to use malloc/vs/rtems_workspace_alloc.

Jennifer Averett jennifer.averett at oarcorp.com
Thu Jul 24 13:54:54 UTC 2014


---
 cpukit/libmisc/capture/capture.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/cpukit/libmisc/capture/capture.c b/cpukit/libmisc/capture/capture.c
index 9ec07b8..1fac4a0 100644
--- a/cpukit/libmisc/capture/capture.c
+++ b/cpukit/libmisc/capture/capture.c
@@ -339,9 +339,9 @@ rtems_capture_create_control (rtems_name name, rtems_id id)
 
   if (control == NULL)
   {
-    bool ok = rtems_workspace_allocate (sizeof (*control), (void **) &control);
+    control = malloc (sizeof (*control));
 
-    if (!ok)
+    if (control == NULL)
     {
       capture_flags |= RTEMS_CAPTURE_NO_MEMORY;
       return NULL;
@@ -386,11 +386,10 @@ rtems_capture_create_capture_task (rtems_tcb* new_task)
   rtems_capture_control_t*     control;
   rtems_name                   name;
   rtems_capture_time_t         time;
-  bool                         ok;
 
-  ok = rtems_workspace_allocate (sizeof (*task), (void **) &task);
+  task = malloc (sizeof (*task));
 
-  if (!ok)
+  if (task == NULL)
   {
     capture_flags |= RTEMS_CAPTURE_NO_MEMORY;
     return NULL;
@@ -480,7 +479,7 @@ rtems_capture_destroy_capture_task (rtems_capture_task_t* task)
 
     rtems_interrupt_lock_release (&capture_lock, &lock_context);
 
-    rtems_workspace_free (task);
+    free (task);
   }
 }
 
@@ -1027,7 +1026,7 @@ rtems_capture_close (void)
   {
     rtems_capture_task_t* delete = task;
     task = task->forw;
-    rtems_workspace_free (delete);
+    free (delete);
   }
 
   capture_tasks = NULL;
@@ -1038,7 +1037,7 @@ rtems_capture_close (void)
   {
     rtems_capture_control_t* delete = control;
     control = control->next;
-    rtems_workspace_free (delete);
+    free (delete);
   }
 
   capture_controls = NULL;
@@ -1216,7 +1215,7 @@ rtems_capture_watch_del (rtems_name name, rtems_id id)
 
       rtems_interrupt_lock_release (&capture_lock, &lock_context);
 
-      rtems_workspace_free (control);
+      free (control);
 
       control = *prev_control;
 
-- 
1.8.1.4



More information about the devel mailing list