Remove the *allocm() API, which is superceded by the *allocx() API.
This commit is contained in:
@@ -1867,91 +1867,6 @@ je_malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void *ptr)
|
||||
* End non-standard functions.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/*
|
||||
* Begin experimental functions.
|
||||
*/
|
||||
#ifdef JEMALLOC_EXPERIMENTAL
|
||||
|
||||
int
|
||||
je_allocm(void **ptr, size_t *rsize, size_t size, int flags)
|
||||
{
|
||||
void *p;
|
||||
|
||||
assert(ptr != NULL);
|
||||
|
||||
p = je_mallocx(size, flags);
|
||||
if (p == NULL)
|
||||
return (ALLOCM_ERR_OOM);
|
||||
if (rsize != NULL)
|
||||
*rsize = isalloc(p, config_prof);
|
||||
*ptr = p;
|
||||
return (ALLOCM_SUCCESS);
|
||||
}
|
||||
|
||||
int
|
||||
je_rallocm(void **ptr, size_t *rsize, size_t size, size_t extra, int flags)
|
||||
{
|
||||
int ret;
|
||||
bool no_move = flags & ALLOCM_NO_MOVE;
|
||||
|
||||
assert(ptr != NULL);
|
||||
assert(*ptr != NULL);
|
||||
assert(size != 0);
|
||||
assert(SIZE_T_MAX - size >= extra);
|
||||
|
||||
if (no_move) {
|
||||
size_t usize = je_xallocx(*ptr, size, extra, flags);
|
||||
ret = (usize >= size) ? ALLOCM_SUCCESS : ALLOCM_ERR_NOT_MOVED;
|
||||
if (rsize != NULL)
|
||||
*rsize = usize;
|
||||
} else {
|
||||
void *p = je_rallocx(*ptr, size+extra, flags);
|
||||
if (p != NULL) {
|
||||
*ptr = p;
|
||||
ret = ALLOCM_SUCCESS;
|
||||
} else
|
||||
ret = ALLOCM_ERR_OOM;
|
||||
if (rsize != NULL)
|
||||
*rsize = isalloc(*ptr, config_prof);
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
je_sallocm(const void *ptr, size_t *rsize, int flags)
|
||||
{
|
||||
|
||||
assert(rsize != NULL);
|
||||
*rsize = je_sallocx(ptr, flags);
|
||||
return (ALLOCM_SUCCESS);
|
||||
}
|
||||
|
||||
int
|
||||
je_dallocm(void *ptr, int flags)
|
||||
{
|
||||
|
||||
je_dallocx(ptr, flags);
|
||||
return (ALLOCM_SUCCESS);
|
||||
}
|
||||
|
||||
int
|
||||
je_nallocm(size_t *rsize, size_t size, int flags)
|
||||
{
|
||||
size_t usize;
|
||||
|
||||
usize = je_nallocx(size, flags);
|
||||
if (usize == 0)
|
||||
return (ALLOCM_ERR_OOM);
|
||||
if (rsize != NULL)
|
||||
*rsize = usize;
|
||||
return (ALLOCM_SUCCESS);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
* End experimental functions.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/*
|
||||
* The following functions are used by threading libraries for protection of
|
||||
* malloc during fork().
|
||||
|
Reference in New Issue
Block a user