aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-11-22 13:19:44 +0100
committerBjörn Gustavsson <[email protected]>2012-01-11 16:43:38 +0100
commit7b8b454ee8c94abe789377590423506b95a5e109 (patch)
tree1f69dfbcbf8546821a57c7152e0bf60d66cfd9c6
parentb07e9f5652106a4b07335b51763192421b1671c8 (diff)
downloadotp-7b8b454ee8c94abe789377590423506b95a5e109.tar.gz
otp-7b8b454ee8c94abe789377590423506b95a5e109.tar.bz2
otp-7b8b454ee8c94abe789377590423506b95a5e109.zip
beam_load.c: Remove useless call to next_heap_size()
The idea was probably to cause less fragmentation. Even if that would be true, it is irrelevant because the short-lived allocator that is used does not have any problems with fragmentation. In CodeNeed() we will simply double the size of the area used for code instead of using the next heap size.
-rw-r--r--erts/emulator/beam/beam_load.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index a510632220..3baef6906e 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -666,7 +666,7 @@ erts_prepare_loading(LoaderState* stp, Process *c_p, Eterm group_leader,
/*
* Initialize code area.
*/
- stp->code_buffer_size = erts_next_heap_size(2048 + stp->num_functions, 0);
+ stp->code_buffer_size = 2048 + stp->num_functions;
stp->code = (BeamInstr *) erts_alloc(ERTS_ALC_T_CODE,
sizeof(BeamInstr) * stp->code_buffer_size);
@@ -1218,8 +1218,7 @@ load_atom_table(LoaderState* stp)
GetInt(stp, 4, stp->num_atoms);
stp->num_atoms++;
stp->atom = erts_alloc(ERTS_ALC_T_LOADER_TMP,
- erts_next_heap_size((stp->num_atoms*sizeof(Eterm)),
- 0));
+ stp->num_atoms*sizeof(Eterm));
/*
* Read all atoms.
@@ -1264,9 +1263,7 @@ load_import_table(LoaderState* stp)
GetInt(stp, 4, stp->num_imports);
stp->import = erts_alloc(ERTS_ALC_T_LOADER_TMP,
- erts_next_heap_size((stp->num_imports *
- sizeof(ImportEntry)),
- 0));
+ stp->num_imports * sizeof(ImportEntry));
for (i = 0; i < stp->num_imports; i++) {
int n;
Eterm mod;
@@ -1686,9 +1683,9 @@ read_code_header(LoaderState* stp)
#define CodeNeed(w) do { \
ASSERT(ci <= code_buffer_size); \
if (code_buffer_size < ci+(w)) { \
- code_buffer_size = erts_next_heap_size(ci+(w), 0); \
- stp->code = code \
- = (BeamInstr *) erts_realloc(ERTS_ALC_T_CODE, \
+ code_buffer_size = 2*ci+(w); \
+ stp->code = code = \
+ (BeamInstr *) erts_realloc(ERTS_ALC_T_CODE, \
(void *) code, \
code_buffer_size * sizeof(BeamInstr)); \
} \