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

Function stats_realloc

freebsd/kern/subr_stats.c:392–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392static inline void *
393stats_realloc(void *ptr, size_t oldsz, size_t newsz, int flags)
394{
395
396#ifdef _KERNEL
397 /* Default to M_NOWAIT if neither M_NOWAIT or M_WAITOK are set. */
398 if (!(flags & (M_WAITOK | M_NOWAIT)))
399 flags |= M_NOWAIT;
400 ptr = realloc(ptr, newsz, M_STATS, flags);
401#else /* ! _KERNEL */
402 ptr = realloc(ptr, newsz);
403 if ((flags & M_ZERO) && ptr != NULL) {
404 if (oldsz == 0)
405 memset(ptr, '\0', newsz);
406 else if (newsz > oldsz)
407 memset(BLOB_OFFSET(ptr, oldsz), '\0', newsz - oldsz);
408 }
409#endif /* _KERNEL */
410
411 return (ptr);
412}
413
414static inline char *
415stats_strdup(const char *s,

Callers 9

stats_vss_hist_hlprFunction · 0.85
stats_vss_tdgst_hlprFunction · 0.85
stats_vss_numeric_hlprFunction · 0.85
stats_v1_blob_cloneFunction · 0.85
stats_v1_tpl_allocFunction · 0.85
stats_v1_blob_allocFunction · 0.85
stats_v1_blob_expandFunction · 0.85
stats_tpl_sample_ratesFunction · 0.85

Calls 2

memsetFunction · 0.85
reallocFunction · 0.70

Tested by

no test coverage detected