Author: florian
Date: Thu Sep 11 22:15:39 2014
New Revision: 14518
Log:
Remove some unneded checks as identified by IBM's BEAM checker.
Modified:
trunk/cachegrind/cg_merge.c
trunk/callgrind/dump.c
trunk/coregrind/m_main.c
trunk/coregrind/m_mallocfree.c
trunk/coregrind/m_scheduler/sched-lock-generic.c
trunk/drd/drd_thread.c
Modified: trunk/cachegrind/cg_merge.c
==============================================================================
--- trunk/cachegrind/cg_merge.c (original)
+++ trunk/cachegrind/cg_merge.c Thu Sep 11 22:15:39 2014
@@ -741,10 +741,8 @@
// since the summary counts are OK, free up the summary_line text
// which contains the same info.
- if (cpf->summary_line) {
- free(cpf->summary_line);
- cpf->summary_line = NULL;
- }
+ free(cpf->summary_line);
+ cpf->summary_line = NULL;
free(curr_fn);
free(curr_fl);
Modified: trunk/callgrind/dump.c
==============================================================================
--- trunk/callgrind/dump.c (original)
+++ trunk/callgrind/dump.c Thu Sep 11 22:15:39 2014
@@ -1501,7 +1501,7 @@
init_fpos(&lastFnPos);
init_apos(&lastAPos, 0, 0, 0);
- if (p) while(1) {
+ while(1) {
/* on context/function change, print old cost buffer before */
if (lastFnPos.cxt && ((*p==0) ||
@@ -1557,7 +1557,7 @@
}
close_dumpfile(print_fd);
- if (array) VG_(free)(array);
+ VG_(free)(array);
/* set counters of last dump */
CLG_(copy_cost)( CLG_(sets).full, ti->lastdump_cost,
Modified: trunk/coregrind/m_main.c
==============================================================================
--- trunk/coregrind/m_main.c (original)
+++ trunk/coregrind/m_main.c Thu Sep 11 22:15:39 2014
@@ -1677,7 +1677,7 @@
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Starting the dynamic memory manager\n");
{ void* p = VG_(malloc)( "main.vm.1", 12345 );
- if (p) VG_(free)( p );
+ VG_(free)( p );
}
VG_(debugLog)(1, "main", "Dynamic memory manager is running\n");
Modified: trunk/coregrind/m_mallocfree.c
==============================================================================
--- trunk/coregrind/m_mallocfree.c (original)
+++ trunk/coregrind/m_mallocfree.c Thu Sep 11 22:15:39 2014
@@ -2574,6 +2574,7 @@
// All just wrappers to avoid exposing arenas to tools.
+// This function never returns NULL.
void* VG_(malloc) ( const HChar* cc, SizeT nbytes )
{
return VG_(arena_malloc) ( VG_AR_CORE, cc, nbytes );
Modified: trunk/coregrind/m_scheduler/sched-lock-generic.c
==============================================================================
--- trunk/coregrind/m_scheduler/sched-lock-generic.c (original)
+++ trunk/coregrind/m_scheduler/sched-lock-generic.c Thu Sep 11 22:15:39 2014
@@ -51,8 +51,7 @@
struct sched_lock *p;
p = VG_(malloc)("sched_lock", sizeof(*p));
- if (p)
- ML_(sema_init)(&p->sema);
+ ML_(sema_init)(&p->sema);
return p;
}
Modified: trunk/drd/drd_thread.c
==============================================================================
--- trunk/drd/drd_thread.c (original)
+++ trunk/drd/drd_thread.c Thu Sep 11 22:15:39 2014
@@ -380,7 +380,7 @@
HChar* msg;
msg = VG_(malloc)("drd.main.dptj.1", msg_size);
- tl_assert(msg);
+
VG_(snprintf)(msg, msg_size,
"drd_post_thread_join joiner = %d, joinee = %d",
drd_joiner, drd_joinee);
|