Skip to contentSkip to conversation

cluster/rgmanager ChangeLog src/clulib/alloc.c

Cluster-devel [email protected] 1 participant 1 message Jun 21, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: fabbione at sourceware.org 2007-06-21 18:39:08

Modified files:
rgmanager : ChangeLog
rgmanager/src/clulib: alloc.c

Log message:
Fix build on ia64 by adding a temporary workaround and make sure to wrap STACKSIZE properly withing DEBUG.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/ChangeLog.diff?cvsroot=cluster&r1=1.47&r2=1.48
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/clulib/alloc.c.diff?cvsroot=cluster&r1=1.10&r2=1.11

rgmanager/ChangeLog +6 -0
@@ -1,3 +1,9 @@
+2007-06-21 Fabio M. Di Nitto <[email protected]>
+	* rgmanager/src/clulib/alloc.c: Undefine DEBUG when building on IA64.
+	The __builtin_address functionality should be taken from libunwind
+	but porting requires some work. For now use this workaround and
+	also make sure to wrap STACKSIZE withing DEBUG.
+
 2007-06-14 Lon Hohberger <[email protected]>
 	* include/resgroup.h: Fix size incompatibility on 32/64 bit mixed
 	clusters.  Put in stubs for intelligent handling of state sizes
rgmanager/src/clulib/alloc.c +9 -1
@@ -116,9 +116,11 @@
 #include <unistd.h>
 #include <sys/wait.h>
 
+#ifndef __ia64__
 #ifndef DEBUG
 #define DEBUG			/* Record program counter of malloc/calloc */
 #endif				/* or realloc call; print misc stuff out */
+#endif
 
 /* Tunable stuff XXX This should be external */
 #define PARANOID		/* Trade off a bit of space and speed for
@@ -667,7 +669,7 @@
 
 #define stack_pointer(n) \
 	(__builtin_frame_address(n)?__builtin_return_address(n):NULL)
-			
+
 #define assign_address(_ptr, _cnt) \
 { \
 	switch(_cnt) { \
@@ -806,10 +808,12 @@
 free(void *p)
 {
 	memblock_t *b;
+#ifdef DEBUG
 #ifdef STACKSIZE
 	void *pc = __builtin_return_address(0);
 	int x;
 #endif
+#endif
 
 	if (!p) {
 #if 0
@@ -862,11 +866,13 @@
 	}
 #endif
 
+#ifdef DEBUG
 #ifdef STACKSIZE
 	for (x = 0; x < STACKSIZE; x++)
 		b->mb_pc[x] = NULL;
 	b->mb_pc[0] = pc;
 #endif
+#endif
 
 	b->mb_state = ST_FREE;
 	b->mb_next = NULL;
@@ -981,11 +987,13 @@
 #ifdef PARANOID
 	int any = 0;
 	int x;
+#ifdef DEBUG
 #ifdef STACKSIZE
 #ifndef GDB_HOOK
 	int sp;
 #endif
 #endif
+#endif
 	memblock_t *b;
 
 	fflush(stdout);