summaryrefslogtreecommitdiff
path: root/libraries/integer-gmp/cbits/alloc.c
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-06-21 18:29:57 +0000
committerIan Lynagh <igloo@earth.li>2009-06-21 18:29:57 +0000
commitcfc1d39281bda1b4cc227043e24d15ad09bb36ba (patch)
tree43037e9766b6864d5cdadd3a87f8bcf0066d2cb3 /libraries/integer-gmp/cbits/alloc.c
parentee937549311be5f00d181c9385ea278ebf01653b (diff)
downloadhaskell-cfc1d39281bda1b4cc227043e24d15ad09bb36ba.tar.gz
Patch GMP to always use the GHC allocation functions
This works around a crash (only on OS X for some reason?) where the GHCi GMP uses the systems memory allocator. We should fix this properly, by making ghci run constructor functions.
Diffstat (limited to 'libraries/integer-gmp/cbits/alloc.c')
-rw-r--r--libraries/integer-gmp/cbits/alloc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libraries/integer-gmp/cbits/alloc.c b/libraries/integer-gmp/cbits/alloc.c
index 27713865eb..d1d922979e 100644
--- a/libraries/integer-gmp/cbits/alloc.c
+++ b/libraries/integer-gmp/cbits/alloc.c
@@ -10,9 +10,9 @@
#include "gmp.h"
-static void * stgAllocForGMP (size_t size_in_bytes);
-static void * stgReallocForGMP (void *ptr, size_t old_size, size_t new_size);
-static void stgDeallocForGMP (void *ptr STG_UNUSED, size_t size STG_UNUSED);
+void * stgAllocForGMP (size_t size_in_bytes);
+void * stgReallocForGMP (void *ptr, size_t old_size, size_t new_size);
+void stgDeallocForGMP (void *ptr STG_UNUSED, size_t size STG_UNUSED);
static void initAllocForGMP( void ) __attribute__((constructor));
@@ -62,7 +62,7 @@ static void initAllocForGMP( void )
only allocate() style allocation.
-------------------------------------------------------------------------- */
-static void *
+void *
stgAllocForGMP (size_t size_in_bytes)
{
StgArrWords* arr;
@@ -80,7 +80,7 @@ stgAllocForGMP (size_t size_in_bytes)
return arr->payload;
}
-static void *
+void *
stgReallocForGMP (void *ptr, size_t old_size, size_t new_size)
{
size_t min_size;
@@ -98,7 +98,7 @@ stgReallocForGMP (void *ptr, size_t old_size, size_t new_size)
return(new_stuff_ptr);
}
-static void
+void
stgDeallocForGMP (void *ptr STG_UNUSED, size_t size STG_UNUSED)
{
/* easy for us: the garbage collector does the dealloc'n */