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
cff3894c
Commit
cff3894c
authored
Jan 11, 2022
by
legoyb
Browse files
Adapted Type Pointer
parent
e4fe44fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
src/mem_internals.c
src/mem_internals.c
+4
-6
No files found.
src/mem_internals.c
View file @
cff3894c
...
...
@@ -20,17 +20,15 @@ void *mark_memarea_and_get_user_ptr(void *ptr, unsigned long size, MemKind k)
unsigned
long
magic_value
=
knuth_mmix_one_round
(
*
(
unsigned
long
*
)
ptr
)
&
~
(
0
b11UL
)
&
(
unsigned
long
)
k
;
unsigned
long
real_size
=
size
+
32
;
unsigned
long
*
pointer
=
(
unsigned
long
*
)
ptr
;
// Set First 16 bytes
*
pointe
r
=
real_size
;
*
(
pointe
r
+
8
)
=
magic_value
;
*
(
unsigned
long
*
)
pt
r
=
real_size
;
*
(
unsigned
long
*
)
(
pt
r
+
8
)
=
magic_value
;
// TODO: set to 0 ?
// Set Last 16 bytes
*
(
pointe
r
+
size
+
16
)
=
magic_value
;
*
(
pointe
r
+
size
+
24
)
=
real_size
;
*
(
unsigned
long
*
)
(
pt
r
+
size
+
16
)
=
magic_value
;
*
(
unsigned
long
*
)
(
pt
r
+
size
+
24
)
=
real_size
;
return
ptr
+
16
;
}
...
...
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