MCPcopy Create free account
hub / github.com/F-Stack/f-stack / imalloc

Function imalloc

app/redis-6.2.6/deps/jemalloc/src/jemalloc.c:1984–2010  ·  view source on GitHub ↗

Returns the errno-style error code of the allocation. */

Source from the content-addressed store, hash-verified

1982
1983/* Returns the errno-style error code of the allocation. */
1984JEMALLOC_ALWAYS_INLINE int
1985imalloc(static_opts_t *sopts, dynamic_opts_t *dopts) {
1986 if (unlikely(!malloc_initialized()) && unlikely(malloc_init())) {
1987 if (config_xmalloc && unlikely(opt_xmalloc)) {
1988 malloc_write(sopts->oom_string);
1989 abort();
1990 }
1991 UTRACE(NULL, dopts->num_items * dopts->item_size, NULL);
1992 set_errno(ENOMEM);
1993 *dopts->result = NULL;
1994
1995 return ENOMEM;
1996 }
1997
1998 /* We always need the tsd. Let's grab it right away. */
1999 tsd_t *tsd = tsd_fetch();
2000 assert(tsd);
2001 if (likely(tsd_fast(tsd))) {
2002 /* Fast and common path. */
2003 tsd_assert_fast(tsd);
2004 sopts->slow = false;
2005 return imalloc_body(sopts, dopts, tsd);
2006 } else {
2007 sopts->slow = true;
2008 return imalloc_body(sopts, dopts, tsd);
2009 }
2010}
2011/******************************************************************************/
2012/*
2013 * Begin malloc(3)-compatible functions.

Callers 2

JEMALLOC_ATTRFunction · 0.85
jemalloc.cFile · 0.85

Calls 9

malloc_initializedFunction · 0.85
malloc_writeFunction · 0.85
abortClass · 0.85
set_errnoFunction · 0.85
tsd_fetchFunction · 0.85
tsd_fastFunction · 0.85
tsd_assert_fastFunction · 0.85
imalloc_bodyFunction · 0.85
malloc_initFunction · 0.70

Tested by

no test coverage detected