Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Bastien Legoy
ensimag-malloc
Commits
b724ec4f
Commit
b724ec4f
authored
Oct 08, 2018
by
Grégory Mounié
Browse files
BUG: test d'erreur reallocation medium ne fonctionnait pas
parent
9e3d1c16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/mem_internals.c
src/mem_internals.c
+2
-2
No files found.
src/mem_internals.c
View file @
b724ec4f
...
...
@@ -58,11 +58,11 @@ mem_realloc_medium() {
MAP_PRIVATE
|
MAP_ANONYMOUS
,
-
1
,
0
);
if
(
arena
.
TZL
[
indice
]
==
MAP_FAILED
)
handle_fatalError
(
"medium realloc"
);
// align allocation to a multiple of the size
// for buddy algo
arena
.
TZL
[
indice
]
+=
(
size
-
(((
intptr_t
)
arena
.
TZL
[
indice
])
%
size
));
if
(
arena
.
TZL
[
indice
]
==
MAP_FAILED
&&
arena
.
TZL
[
indice
]
==
0
)
handle_fatalError
(
"medium realloc"
);
arena
.
medium_next_exponant
++
;
return
size
;
// lie on allocation size, but never free
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment