<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-02-15)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-02-15 Joel Sherrill <joel.sherrilL@OARcorp.com>
* libmisc/capture/capture.c, posix/src/keyfreememory.c,
posix/src/pthread.c, score/include/rtems/score/wkspace.h,
score/src/objectextendinformation.c,
score/src/objectnamespaceremove.c, score/src/objectsetname.c,
score/src/threadclose.c, score/src/threadinitialize.c,
score/src/wkspace.c: Many places were checking for a NULL pointer
before calling _Workspace_Free. By moving the check into
_Workspace_Free, we eliminate a number of conditional paths and make
it harder to return a NULL pointer.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2712&r2=text&tr2=1.2713&diff_format=h">M</a></td><td width='1%'>1.2713</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/capture/capture.c.diff?r1=text&tr1=1.21&r2=text&tr2=1.22&diff_format=h">M</a></td><td width='1%'>1.22</td><td width='100%'>cpukit/libmisc/capture/capture.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/keyfreememory.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.2&diff_format=h">M</a></td><td width='1%'>1.2</td><td width='100%'>cpukit/posix/src/keyfreememory.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/posix/src/pthread.c.diff?r1=text&tr1=1.81&r2=text&tr2=1.82&diff_format=h">M</a></td><td width='1%'>1.82</td><td width='100%'>cpukit/posix/src/pthread.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/include/rtems/score/wkspace.h.diff?r1=text&tr1=1.30&r2=text&tr2=1.31&diff_format=h">M</a></td><td width='1%'>1.31</td><td width='100%'>cpukit/score/include/rtems/score/wkspace.h</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/objectextendinformation.c.diff?r1=text&tr1=1.22&r2=text&tr2=1.23&diff_format=h">M</a></td><td width='1%'>1.23</td><td width='100%'>cpukit/score/src/objectextendinformation.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/objectnamespaceremove.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>cpukit/score/src/objectnamespaceremove.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/objectsetname.c.diff?r1=text&tr1=1.8&r2=text&tr2=1.9&diff_format=h">M</a></td><td width='1%'>1.9</td><td width='100%'>cpukit/score/src/objectsetname.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadclose.c.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>cpukit/score/src/threadclose.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/threadinitialize.c.diff?r1=text&tr1=1.41&r2=text&tr2=1.42&diff_format=h">M</a></td><td width='1%'>1.42</td><td width='100%'>cpukit/score/src/threadinitialize.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/score/src/wkspace.c.diff?r1=text&tr1=1.33&r2=text&tr2=1.34&diff_format=h">M</a></td><td width='1%'>1.34</td><td width='100%'>cpukit/score/src/wkspace.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2712 rtems/cpukit/ChangeLog:1.2713
--- rtems/cpukit/ChangeLog:1.2712 Mon Feb 14 20:31:05 2011
+++ rtems/cpukit/ChangeLog Tue Feb 15 18:24:48 2011
</font><font color='#997700'>@@ -1,3 +1,15 @@
</font><font color='#000088'>+2011-02-15 Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+ * libmisc/capture/capture.c, posix/src/keyfreememory.c,
+ posix/src/pthread.c, score/include/rtems/score/wkspace.h,
+ score/src/objectextendinformation.c,
+ score/src/objectnamespaceremove.c, score/src/objectsetname.c,
+ score/src/threadclose.c, score/src/threadinitialize.c,
+ score/src/wkspace.c: Many places were checking for a NULL pointer
+ before calling _Workspace_Free. By moving the check into
+ _Workspace_Free, we eliminate a number of conditional paths and make
+ it harder to return a NULL pointer.
+
</font> 2011-02-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* rtems/src/semtranslatereturncode.c,
<font color='#006600'>diff -u rtems/cpukit/libmisc/capture/capture.c:1.21 rtems/cpukit/libmisc/capture/capture.c:1.22
--- rtems/cpukit/libmisc/capture/capture.c:1.21 Fri Jan 21 13:40:17 2011
+++ rtems/cpukit/libmisc/capture/capture.c Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -494,8 +494,7 @@
</font>
rtems_interrupt_enable (level);
<font color='#880000'>- if (task)
- _Workspace_Free (task);
</font><font color='#000088'>+ _Workspace_Free (task);
</font> }
}
<font color='#006600'>diff -u rtems/cpukit/posix/src/keyfreememory.c:1.1 rtems/cpukit/posix/src/keyfreememory.c:1.2
--- rtems/cpukit/posix/src/keyfreememory.c:1.1 Mon Jul 26 17:03:18 2010
+++ rtems/cpukit/posix/src/keyfreememory.c Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -25,6 +25,5 @@
</font> uint32_t the_api;
for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ )
<font color='#880000'>- if ( the_key->Values[ the_api ] )
- _Workspace_Free( the_key->Values[ the_api ] );
</font><font color='#000088'>+ _Workspace_Free( the_key->Values[ the_api ] );
</font> }
<font color='#006600'>diff -u rtems/cpukit/posix/src/pthread.c:1.81 rtems/cpukit/posix/src/pthread.c:1.82
--- rtems/cpukit/posix/src/pthread.c:1.81 Mon Oct 4 10:32:36 2010
+++ rtems/cpukit/posix/src/pthread.c Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -270,7 +270,7 @@
</font>
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
<font color='#880000'>- (void) _Workspace_Free( api );
</font><font color='#000088'>+ _Workspace_Free( api );
</font> }
/*
<font color='#006600'>diff -u rtems/cpukit/score/include/rtems/score/wkspace.h:1.30 rtems/cpukit/score/include/rtems/score/wkspace.h:1.31
--- rtems/cpukit/score/include/rtems/score/wkspace.h:1.30 Fri Nov 27 23:58:54 2009
+++ rtems/cpukit/score/include/rtems/score/wkspace.h Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -70,10 +70,12 @@
</font> *
* @param block is the memory to free
*
<font color='#880000'>- * @return true if the free was successful.
</font><font color='#000088'>+ * @note If @a block is equal to NULL, then the request is ignored.
+ * This allows the caller to not worry about whether or not
+ * a pointer is NULL.
</font> */
<font color='#880000'>-bool _Workspace_Free(
</font><font color='#000088'>+void _Workspace_Free(
</font> void *block
);
<font color='#006600'>diff -u rtems/cpukit/score/src/objectextendinformation.c:1.22 rtems/cpukit/score/src/objectextendinformation.c:1.23
--- rtems/cpukit/score/src/objectextendinformation.c:1.22 Mon Jun 21 11:27:37 2010
+++ rtems/cpukit/score/src/objectextendinformation.c Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -221,8 +221,7 @@
</font>
_ISR_Enable( level );
<font color='#880000'>- if ( old_tables )
- _Workspace_Free( old_tables );
</font><font color='#000088'>+ _Workspace_Free( old_tables );
</font>
block_count++;
}
<font color='#006600'>diff -u rtems/cpukit/score/src/objectnamespaceremove.c:1.2 rtems/cpukit/score/src/objectnamespaceremove.c:1.3
--- rtems/cpukit/score/src/objectnamespaceremove.c:1.2 Fri Sep 11 09:54:29 2009
+++ rtems/cpukit/score/src/objectnamespaceremove.c Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -26,7 +26,7 @@
</font> /*
* If this is a string format name, then free the memory.
*/
<font color='#880000'>- if ( information->is_string && the_object->name.name_p )
</font><font color='#000088'>+ if ( information->is_string )
</font> _Workspace_Free( (void *)the_object->name.name_p );
#endif
<font color='#006600'>diff -u rtems/cpukit/score/src/objectsetname.c:1.8 rtems/cpukit/score/src/objectsetname.c:1.9
--- rtems/cpukit/score/src/objectsetname.c:1.8 Mon Dec 7 11:27:46 2009
+++ rtems/cpukit/score/src/objectsetname.c Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -47,10 +47,8 @@
</font> if ( !d )
return false;
<font color='#880000'>- if ( the_object->name.name_p ) {
- _Workspace_Free( (void *)the_object->name.name_p );
- the_object->name.name_p = NULL;
- }
</font><font color='#000088'>+ _Workspace_Free( (void *)the_object->name.name_p );
+ the_object->name.name_p = NULL;
</font>
strncpy( d, name, length );
d[length] = '\0';
<font color='#006600'>diff -u rtems/cpukit/score/src/threadclose.c:1.14 rtems/cpukit/score/src/threadclose.c:1.15
--- rtems/cpukit/score/src/threadclose.c:1.14 Fri Jan 28 14:24:53 2011
+++ rtems/cpukit/score/src/threadclose.c Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -101,8 +101,7 @@
</font> #endif
the_thread->fp_context = NULL;
<font color='#880000'>- if ( the_thread->Start.fp_context )
- (void) _Workspace_Free( the_thread->Start.fp_context );
</font><font color='#000088'>+ _Workspace_Free( the_thread->Start.fp_context );
</font> #endif
/*
<font color='#997700'>@@ -112,7 +111,6 @@
</font> _Thread_Stack_Free( the_thread );
the_thread->Start.stack = NULL;
<font color='#880000'>- if ( the_thread->extensions )
- (void) _Workspace_Free( the_thread->extensions );
</font><font color='#000088'>+ _Workspace_Free( the_thread->extensions );
</font> the_thread->extensions = NULL;
}
<font color='#006600'>diff -u rtems/cpukit/score/src/threadinitialize.c:1.41 rtems/cpukit/score/src/threadinitialize.c:1.42
--- rtems/cpukit/score/src/threadinitialize.c:1.41 Fri Jan 28 14:24:54 2011
+++ rtems/cpukit/score/src/threadinitialize.c Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -225,26 +225,19 @@
</font> return true;
failed:
<font color='#880000'>- if ( the_thread->libc_reent )
- _Workspace_Free( the_thread->libc_reent );
</font><font color='#000088'>+ _Workspace_Free( the_thread->libc_reent );
</font>
for ( i=0 ; i <= THREAD_API_LAST ; i++ )
<font color='#880000'>- if ( the_thread->API_Extensions[i] )
- _Workspace_Free( the_thread->API_Extensions[i] );
</font><font color='#000088'>+ _Workspace_Free( the_thread->API_Extensions[i] );
</font>
<font color='#880000'>- if ( extensions_area )
- (void) _Workspace_Free( extensions_area );
</font><font color='#000088'>+ _Workspace_Free( extensions_area );
</font>
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
<font color='#880000'>- if ( fp_area )
- (void) _Workspace_Free( fp_area );
</font><font color='#000088'>+ _Workspace_Free( fp_area );
</font> #endif
<font color='#880000'>- if ( sched )
- (void) _Workspace_Free( sched );
</font><font color='#000088'>+ _Workspace_Free( sched );
</font>
_Thread_Stack_Free( the_thread );
return false;
<font color='#880000'>-
-
</font> }
<font color='#006600'>diff -u rtems/cpukit/score/src/wkspace.c:1.33 rtems/cpukit/score/src/wkspace.c:1.34
--- rtems/cpukit/score/src/wkspace.c:1.33 Wed Apr 7 12:05:29 2010
+++ rtems/cpukit/score/src/wkspace.c Tue Feb 15 18:24:49 2011
</font><font color='#997700'>@@ -79,7 +79,7 @@
</font> /*
* _Workspace_Free
*/
<font color='#880000'>-bool _Workspace_Free(
</font><font color='#000088'>+void _Workspace_Free(
</font> void *block
)
{
<font color='#997700'>@@ -91,7 +91,8 @@
</font> __builtin_return_address( 1 )
);
#endif
<font color='#880000'>- return _Heap_Free( &_Workspace_Area, block );
</font><font color='#000088'>+ if (block)
+ _Heap_Free( &_Workspace_Area, block );
</font> }
/*
</pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>