Explorar el Código

2008-06-14 Zoltan Varga <[email protected]>

	* mono-codeman.c (new_codechunk): Allocate memory for dynamic code managers
	using dlmemalign.

	* dlmalloc.c: Enable the memalign functions.

svn path=/trunk/mono/; revision=105837
Zoltan Varga hace 17 años
padre
commit
b794606c5f
Se han modificado 3 ficheros con 16 adiciones y 1 borrados
  1. 7 0
      mono/utils/ChangeLog
  2. 8 0
      mono/utils/dlmalloc.c
  3. 1 1
      mono/utils/mono-codeman.c

+ 7 - 0
mono/utils/ChangeLog

@@ -1,3 +1,10 @@
+2008-06-14  Zoltan Varga  <[email protected]>
+
+	* mono-codeman.c (new_codechunk): Allocate memory for dynamic code managers
+	using dlmemalign.
+
+	* dlmalloc.c: Enable the memalign functions.
+
 2008-06-05  Zoltan Varga  <[email protected]>
 
 	* Makefile.am (libmonoutils_la_SOURCES): Add dtrace.h.

+ 8 - 0
mono/utils/dlmalloc.c

@@ -3822,6 +3822,8 @@ static void* internal_realloc(mstate m, void* oldmem, size_t bytes) {
   return 0;
 }
 
+#endif
+
 /* --------------------------- memalign support -------------------------- */
 
 static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {
@@ -3909,6 +3911,8 @@ static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {
   return 0;
 }
 
+#if 0
+
 /* ------------------------ comalloc/coalloc support --------------------- */
 
 static void** ialloc(mstate m,
@@ -4315,10 +4319,14 @@ void* dlrealloc(void* oldmem, size_t bytes) {
   }
 }
 
+#endif
+
 void* dlmemalign(size_t alignment, size_t bytes) {
   return internal_memalign(gm, alignment, bytes);
 }
 
+#if 0
+
 void** dlindependent_calloc(size_t n_elements, size_t elem_size,
                                  void* chunks[]) {
   size_t sz = elem_size; /* serves as 1-element array */

+ 1 - 1
mono/utils/mono-codeman.c

@@ -260,7 +260,7 @@ new_codechunk (int dynamic, int size)
 #endif
 
 	if (flags == CODE_FLAG_MALLOC) {
-		ptr = dlmalloc (chunk_size + MIN_ALIGN - 1);
+		ptr = dlmemalign (MIN_ALIGN, chunk_size + MIN_ALIGN - 1);
 		if (!ptr)
 			return NULL;
 	} else {