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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7c735745
Commit
7c735745
authored
Sep 05, 2005
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#12983
TRASH macro confliciting with TRASH in my_sys.h
parent
47e5e73a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
mysys/my_alloc.c
mysys/my_alloc.c
+4
-8
No files found.
mysys/my_alloc.c
View file @
7c735745
...
...
@@ -221,11 +221,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
#endif
}
#ifdef SAFEMALLOC
#define TRASH(X) bfill(((char*)(X) + ((X)->size-(X)->left)), (X)->left, 0xa5)
#else
#define TRASH
/* no-op */
#endif
#define TRASH_MEM(X) TRASH(((char*)(X) + ((X)->size-(X)->left)), (X)->left)
/* Mark all data in blocks free for reusage */
...
...
@@ -239,7 +235,7 @@ static inline void mark_blocks_free(MEM_ROOT* root)
for
(
next
=
root
->
free
;
next
;
next
=
*
(
last
=
&
next
->
next
))
{
next
->
left
=
next
->
size
-
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
TRASH
(
next
);
TRASH
_MEM
(
next
);
}
/* Combine the free and the used list */
...
...
@@ -249,7 +245,7 @@ static inline void mark_blocks_free(MEM_ROOT* root)
for
(;
next
;
next
=
next
->
next
)
{
next
->
left
=
next
->
size
-
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
TRASH
(
next
);
TRASH
_MEM
(
next
);
}
/* Now everything is set; Indicate that nothing is used anymore */
...
...
@@ -310,7 +306,7 @@ void free_root(MEM_ROOT *root, myf MyFlags)
{
root
->
free
=
root
->
pre_alloc
;
root
->
free
->
left
=
root
->
pre_alloc
->
size
-
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
TRASH
(
root
->
pre_alloc
);
TRASH
_MEM
(
root
->
pre_alloc
);
root
->
free
->
next
=
0
;
}
root
->
block_num
=
4
;
...
...
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