mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 17:47:22 +03:00
Rename geom_grow -> exp_grow.
This was promised in the review of the introduction of geom_grow, but would have been painful to do there because of the series that introduced it. Now that those are comitted, renaming is easier.
This commit is contained in:
parent
b4c37a6e81
commit
4ca3d91e96
14 changed files with 46 additions and 38 deletions
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef JEMALLOC_INTERNAL_ECACHE_GROW_H
|
||||
#define JEMALLOC_INTERNAL_ECACHE_GROW_H
|
||||
#ifndef JEMALLOC_INTERNAL_EXP_GROW_H
|
||||
#define JEMALLOC_INTERNAL_EXP_GROW_H
|
||||
|
||||
typedef struct geom_grow_s geom_grow_t;
|
||||
struct geom_grow_s {
|
||||
typedef struct exp_grow_s exp_grow_t;
|
||||
struct exp_grow_s {
|
||||
/*
|
||||
* Next extent size class in a growing series to use when satisfying a
|
||||
* request via the extent hooks (only if opt_retain). This limits the
|
||||
|
|
@ -19,32 +19,32 @@ struct geom_grow_s {
|
|||
};
|
||||
|
||||
static inline bool
|
||||
geom_grow_size_prepare(geom_grow_t *geom_grow, size_t alloc_size_min,
|
||||
exp_grow_size_prepare(exp_grow_t *exp_grow, size_t alloc_size_min,
|
||||
size_t *r_alloc_size, pszind_t *r_skip) {
|
||||
*r_skip = 0;
|
||||
*r_alloc_size = sz_pind2sz(geom_grow->next + *r_skip);
|
||||
*r_alloc_size = sz_pind2sz(exp_grow->next + *r_skip);
|
||||
while (*r_alloc_size < alloc_size_min) {
|
||||
(*r_skip)++;
|
||||
if (geom_grow->next + *r_skip >=
|
||||
if (exp_grow->next + *r_skip >=
|
||||
sz_psz2ind(SC_LARGE_MAXCLASS)) {
|
||||
/* Outside legal range. */
|
||||
return true;
|
||||
}
|
||||
*r_alloc_size = sz_pind2sz(geom_grow->next + *r_skip);
|
||||
*r_alloc_size = sz_pind2sz(exp_grow->next + *r_skip);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline void
|
||||
geom_grow_size_commit(geom_grow_t *geom_grow, pszind_t skip) {
|
||||
if (geom_grow->next + skip + 1 <= geom_grow->limit) {
|
||||
geom_grow->next += skip + 1;
|
||||
exp_grow_size_commit(exp_grow_t *exp_grow, pszind_t skip) {
|
||||
if (exp_grow->next + skip + 1 <= exp_grow->limit) {
|
||||
exp_grow->next += skip + 1;
|
||||
} else {
|
||||
geom_grow->next = geom_grow->limit;
|
||||
exp_grow->next = exp_grow->limit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void geom_grow_init(geom_grow_t *geom_grow);
|
||||
void exp_grow_init(exp_grow_t *exp_grow);
|
||||
|
||||
#endif /* JEMALLOC_INTERNAL_ECACHE_GROW_H */
|
||||
#endif /* JEMALLOC_INTERNAL_EXP_GROW_H */
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef JEMALLOC_INTERNAL_HPA_H
|
||||
#define JEMALLOC_INTERNAL_HPA_H
|
||||
|
||||
#include "jemalloc/internal/geom_grow.h"
|
||||
#include "jemalloc/internal/exp_grow.h"
|
||||
#include "jemalloc/internal/hpa_central.h"
|
||||
#include "jemalloc/internal/pai.h"
|
||||
#include "jemalloc/internal/psset.h"
|
||||
|
|
@ -29,7 +29,7 @@ struct hpa_s {
|
|||
* small finite number of allocations from it.
|
||||
*/
|
||||
edata_cache_t *edata_cache;
|
||||
geom_grow_t geom_grow;
|
||||
exp_grow_t exp_grow;
|
||||
};
|
||||
|
||||
/* Used only by CTL; not actually stored here (i.e., all derived). */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef JEMALLOC_INTERNAL_PAC_H
|
||||
#define JEMALLOC_INTERNAL_PAC_H
|
||||
|
||||
#include "jemalloc/internal/geom_grow.h"
|
||||
#include "jemalloc/internal/exp_grow.h"
|
||||
#include "jemalloc/internal/pai.h"
|
||||
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ struct pac_s {
|
|||
edata_cache_t *edata_cache;
|
||||
|
||||
/* The grow info for the retained ecache. */
|
||||
geom_grow_t geom_grow;
|
||||
exp_grow_t exp_grow;
|
||||
malloc_mutex_t grow_mtx;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue