Use a stub replacement and disable dss when sbrk is not supported
This commit is contained in:
parent
5ff709c264
commit
83c324acd8
@ -678,6 +678,14 @@ fi
|
||||
],
|
||||
[enable_dss="0"]
|
||||
)
|
||||
dnl Check whether the BSD/SUSv1 sbrk() exists. If not, disable DSS support.
|
||||
AC_CHECK_FUNC([sbrk], [have_sbrk="1"], [have_sbrk="0"])
|
||||
if test "x$have_sbrk" = "x1" ; then
|
||||
AC_DEFINE([JEMALLOC_HAVE_SBRK], [ ])
|
||||
else
|
||||
enable_dss="0"
|
||||
fi
|
||||
|
||||
if test "x$enable_dss" = "x1" ; then
|
||||
AC_DEFINE([JEMALLOC_DSS], [ ])
|
||||
fi
|
||||
|
@ -108,6 +108,9 @@
|
||||
# define JEMALLOC_ATTR(s) JEMALLOC_CATTR(s,)
|
||||
#endif
|
||||
|
||||
/* Defined if sbrk() is supported. */
|
||||
#undef JEMALLOC_HAVE_SBRK
|
||||
|
||||
/* Non-empty if the tls_model attribute is supported. */
|
||||
#undef JEMALLOC_TLS_MODEL
|
||||
|
||||
|
@ -3,6 +3,17 @@
|
||||
/******************************************************************************/
|
||||
/* Data. */
|
||||
|
||||
#ifndef JEMALLOC_HAVE_SBRK
|
||||
void *
|
||||
sbrk(intptr_t increment)
|
||||
{
|
||||
|
||||
not_implemented();
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Protects sbrk() calls. This avoids malloc races among threads, though it
|
||||
* does not protect against races with threads that call sbrk() directly.
|
||||
|
Loading…
Reference in New Issue
Block a user