X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/67920cb215a6d139ad318fbf8eb54903e101dde5..13ec70afab644813396652ff23a6e02fbd3d00d7:/malloc.c diff --git a/malloc.c b/malloc.c index 456bed8..6013e40 100644 --- a/malloc.c +++ b/malloc.c @@ -566,6 +566,9 @@ union overhead { union overhead *ov_next; /* when free */ #if MEM_ALIGNBYTES > 4 double strut; /* alignment problems */ +# if MEM_ALIGNBYTES > 8 + char sstrut[MEM_ALIGNBYTES]; /* for the sizing */ +# endif #endif struct { /* @@ -1065,6 +1068,12 @@ static IV MallocCfg[MallocCfg_last] = { }; IV *MallocCfg_ptr = MallocCfg; +static char* MallocCfgP[MallocCfg_last] = { + 0, /* MallocCfgP_emergency_buffer */ + 0, /* MallocCfgP_emergency_buffer_prepared */ +}; +char **MallocCfgP_ptr = MallocCfgP; + # undef MIN_SBRK # undef FIRST_SBRK # undef MIN_SBRK_FRAC1000 @@ -1087,6 +1096,9 @@ IV *MallocCfg_ptr = MallocCfg; # define FILL_CHECK_CFG MallocCfg[MallocCfg_fillcheck] # define FILL_CHECK (FILL_DEAD && FILL_CHECK_CFG) +# define emergency_buffer MallocCfgP[MallocCfgP_emergency_buffer] +# define emergency_buffer_prepared MallocCfgP[MallocCfgP_emergency_buffer_prepared] + #else /* defined(NO_MALLOC_DYNAMIC_CFG) */ # define FILL_DEAD 1 @@ -1118,14 +1130,13 @@ static u_int goodsbrk; # define BIG_SIZE (1<<16) /* 64K */ # endif -static char *emergency_buffer; -static char *emergency_buffer_prepared; - # ifdef NO_MALLOC_DYNAMIC_CFG static MEM_SIZE emergency_buffer_size; /* 0 if the last request for more memory succeeded. Otherwise the size of the failing request. */ static MEM_SIZE emergency_buffer_last_req; +static char *emergency_buffer; +static char *emergency_buffer_prepared; # endif # ifndef emergency_sbrk_croak