Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rajout du makefile oublié lors du commit précédent.

Correction rustine (guère compréhensible) du code évident le bug
lors de l'augmentation du «heap». Cela se traduit sous amd64 par
un appel à malloc, suivi de la libération du code, suivi d'un nouvel
appel à malloc.

François Boisson 03/10/2012
  • Loading branch information...
commit 1e7284e65a046097a5371c0096980fe84ce695fa 1 parent 27c3240
@FBoisson FBoisson authored
Showing with 18 additions and 5 deletions.
  1. +4 −4 contrib/Makefile
  2. +2 −0  src/runtime/memory.c
  3. +12 −1 src/runtime/misc.c
View
8 contrib/Makefile
@@ -34,7 +34,7 @@ CAML_ONLY_PACKAGES=libnum libstr lorder
CAML_PACKAGES=libunix debugger camlsearch mletags profiler
X11_PACKAGES=libgraph
TK_PACKAGES=camltk4
-
+CAMl_ALL=caml_all
# All architectures should support the following:
# PACKAGES=$(TEXT_PACKAGES)
# All reasonable architectures should support the following:
@@ -44,15 +44,15 @@ TK_PACKAGES=camltk4
# All Unix platforms with a correct installation for X Windows should also support
# the following:
# PACKAGES=\
-# $(TEXT_PACKAGES) $(CAML_ONLY_PACKAGES) $(CAML_PACKAGES) $(X11_PACKAGES)
+# $(TEXT_PACKAGES) $(CAML_ONLY_PACKAGES) $(CAML_PACKAGES) $(X11_PACKAGES) $(CAML_ALL)
# All Unix platforms with a correct installation of X and Tcl/Tk library
# should support the entire collection of packages:
# PACKAGES=\
-# $(TEXT_PACKAGES) $(CAML_ONLY_PACKAGES) $(CAML_PACKAGES) $(X11_PACKAGES) $(TK_PACKAGES)
+# $(TEXT_PACKAGES) $(CAML_ONLY_PACKAGES) $(CAML_PACKAGES) $(X11_PACKAGES) $(TK_PACKAGES) $(CAML_ALL)
#
# Your setting:
PACKAGES=\
- $(TEXT_PACKAGES) $(CAML_ONLY_PACKAGES) $(CAML_PACKAGES) $(X11_PACKAGES) $(TK_PACKAGES)
+ $(TEXT_PACKAGES) $(CAML_ONLY_PACKAGES) $(CAML_PACKAGES) $(X11_PACKAGES) $(TK_PACKAGES) $(CAML_ALL)
#(1) Which C compiler to use with which flags.
View
2  src/runtime/memory.c
@@ -55,7 +55,9 @@ static char *expand_heap (request)
new_page_table = (char *) xmalloc (new_page_table_size);
if (new_page_table == NULL){
gc_message ("No room for growing page table\n", 0);
+/* ce xfree provoque un gros plantage, invalid pointer
xfree (mem);
+*/
return NULL;
}
}
View
13 src/runtime/misc.c
@@ -129,6 +129,17 @@ void memmov (dst, src, length)
#endif /* USING_MEMMOV */
+char *xmalloccorrige(asize_t size) {
+ char *p;
+#ifdef CAML_SIXTYFOUR
+/* aberrant mais sinon, les blocs peuvent ne pas être contigus */
+ p=xmalloc(size);
+ xfree(p);
+#endif
+ p=xmalloc(size);
+ return(p);
+}
+
char * aligned_malloc (size, modulo)
asize_t size;
int modulo;
@@ -136,7 +147,7 @@ char * aligned_malloc (size, modulo)
char *raw_mem;
unsigned long aligned_mem;
Assert (modulo < Page_size);
- raw_mem = (char *) xmalloc (size + Page_size);
+ raw_mem = (char *) xmalloccorrige (size + Page_size);
if (raw_mem == NULL) return NULL;
raw_mem += modulo; /* Address to be aligned */
aligned_mem = (((unsigned long) raw_mem / Page_size + 1) * Page_size);
Please sign in to comment.
Something went wrong with that request. Please try again.