I was getting a wierd error yesterday on the Computer Science (Solaris) servers, using mercury-0.12.2.<br><br>My application would build properly, but the following (borrowed from mtcltk) caused it to abort, saying exclusion ranges overlap. This seems to be related to BoehmGC. Is there anything wrong with the way I am using this, or is it just no longer necessary? It seems to work allright with Tk.
<br><br>:- pragma foreign_code("C", "<br> <br>#ifdef MR_CONSERVATIVE_GC<br><br>/*<br>** The addresses of the closures that we pass to Tk<br>** will be stored by Tk in malloc()'ed memory.<br>** However, it is essential that these pointers be
<br>** visible to the garbage collector, otherwise it will<br>** think that the closures are unreferenced and reuse the storage.<br>** Hence we redefine malloc() and friends to call GC_malloc().<br>*/<br><br>void *malloc(size_t s)
<br>{<br> return GC_MALLOC(s);<br>}<br><br>void *calloc(size_t s, size_t n)<br>{<br> void *t;<br> t = GC_MALLOC(s*n);<br> memset(t, 0, s*n);<br> return t;<br>}<br><br>void *realloc(void *ptr, size_t s)<br>{
<br> return GC_REALLOC(ptr, s);<br>}<br><br>void free(void *ptr)<br>{<br> GC_FREE(ptr);<br>}<br><br>#endif /* MR_CONSERVATIVE_GC */<br><br>").<br><br>Jon<br>