Browse code

- hopefully fixed the sun mysql problems (mallocs are now long long aligned for sparc64 and not only long, even in debugging mode)

Andrei Pelinescu-Onciul authored on 21/05/2003 16:42:34
Showing 3 changed files
... ...
@@ -25,7 +25,7 @@
25 25
 VERSION = 0
26 26
 PATCHLEVEL = 8
27 27
 SUBLEVEL =   11
28
-EXTRAVERSION = pre25
28
+EXTRAVERSION = pre26
29 29
 
30 30
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
31 31
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
... ...
@@ -25,6 +25,12 @@
25 25
  * along with this program; if not, write to the Free Software 
26 26
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27 27
  */
28
+/*
29
+ * History:
30
+ * --------
31
+ *  2003-05-21  on sparc64 roundto 8 even in debugging mode (so malloc'ed
32
+ *               long longs will be 64 bit aligned) (andrei)
33
+ */
28 34
 
29 35
 
30 36
 #if !defined(f_malloc_h) && !defined(VQ_MALLOC) 
... ...
@@ -34,8 +40,19 @@
34 40
 
35 41
 /* defs*/
36 42
 
37
-#define ROUNDTO		sizeof(void*) /* size we round to, must be = 2^n, and
43
+#ifdef DBG_F_MALLOC
44
+#ifdef __CPU_sparc64
45
+/* tricky, on sun in 32 bits mode long long must be 64 bits aligned
46
+ * but long can be 32 bits aligned => malloc should return long long
47
+ * aligned memory */
48
+	#define ROUNDTO		sizeof(long long)
49
+#else
50
+	#define ROUNDTO		sizeof(void*) /* size we round to, must be = 2^n, and
38 51
                       sizeof(fm_frag) must be multiple of ROUNDTO !*/
52
+#endif
53
+#else /* DBG_F_MALLOC */
54
+	#define ROUNDTO 8
55
+#endif
39 56
 #define MIN_FRAG_SIZE	ROUNDTO
40 57
 
41 58
 
... ...
@@ -25,6 +25,12 @@
25 25
  * along with this program; if not, write to the Free Software 
26 26
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27 27
  */
28
+/*
29
+ * History:
30
+ * --------
31
+ *  2003-05-21  on sparc64 roundto 8 even in debugging mode (so malloc'ed
32
+ *               long longs will be 64 bit aligned) (andrei)
33
+ */
28 34
 
29 35
 
30 36
 #if !defined(q_malloc_h) && !defined(VQ_MALLOC) && !defined(F_MALLOC)
... ...
@@ -34,9 +40,16 @@
34 40
 
35 41
 /* defs*/
36 42
 #ifdef DBG_QM_MALLOC
43
+#ifdef __CPU_sparc64
44
+/* tricky, on sun in 32 bits mode long long must be 64 bits aligned
45
+ * but long can be 32 bits aligned => malloc should return long long
46
+ * aligned memory */
47
+	#define ROUNDTO		sizeof(long long)
48
+#else
37 49
 	#define ROUNDTO		sizeof(void*) /* minimum possible ROUNDTO ->heavy 
38 50
 										 debugging*/
39
-#else
51
+#endif 
52
+#else /* DBG_QM_MALLOC */
40 53
 	#define ROUNDTO		16 /* size we round to, must be = 2^n  and also
41 54
 							 sizeof(qm_frag)+sizeof(qm_frag_end)
42 55
 							 must be mutliple of ROUNDTO!