Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
948e8880
Commit
948e8880
authored
Sep 21, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Pull request #868: MDEV-17248 Improve ASAN memory pool instrumentation
parents
e0711894
5b25dc6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
include/my_valgrind.h
include/my_valgrind.h
+2
-2
mysys/my_alloc.c
mysys/my_alloc.c
+2
-1
No files found.
include/my_valgrind.h
View file @
948e8880
...
...
@@ -49,9 +49,9 @@
#endif
/* HAVE_VALGRIND */
#ifndef DBUG_OFF
#define TRASH_FILL(A,B,C) do {
MEM_UNDEFINED(A,B); memset(A,C,B); } while
(0)
#define TRASH_FILL(A,B,C) do {
const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while
(0)
#else
#define TRASH_FILL(A,B,C)
do { MEM_UNDEFINED(A,B); } while
(0)
#define TRASH_FILL(A,B,C)
do { const size_t trash_tmp __attribute__((unused))= (B); MEM_UNDEFINED(A,trash_tmp); } while
(0)
#endif
#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)
mysys/my_alloc.c
View file @
948e8880
...
...
@@ -184,6 +184,7 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
uchar
*
point
;
reg1
USED_MEM
*
next
=
0
;
reg2
USED_MEM
**
prev
;
size_t
original_length
=
length
;
DBUG_ENTER
(
"alloc_root"
);
DBUG_PRINT
(
"enter"
,(
"root: 0x%lx"
,
(
long
)
mem_root
));
DBUG_ASSERT
(
alloc_root_inited
(
mem_root
));
...
...
@@ -241,7 +242,7 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
mem_root
->
used
=
next
;
mem_root
->
first_block_usage
=
0
;
}
TRASH_ALLOC
(
point
,
length
);
TRASH_ALLOC
(
point
,
original_
length
);
DBUG_PRINT
(
"exit"
,(
"ptr: 0x%lx"
,
(
ulong
)
point
));
DBUG_RETURN
((
void
*
)
point
);
#endif
...
...
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