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
361a11de
Commit
361a11de
authored
Nov 24, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backport MEM_ROOT::total_alloc removal from 10.5
to fix sizeof(MEM_ROOT)
parent
69d78cd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
8 deletions
+0
-8
include/my_alloc.h
include/my_alloc.h
+0
-1
mysys/my_alloc.c
mysys/my_alloc.c
+0
-7
No files found.
include/my_alloc.h
View file @
361a11de
...
...
@@ -45,7 +45,6 @@ typedef struct st_mem_root
/* if block have less memory it will be put in 'used' list */
size_t
min_malloc
;
size_t
block_size
;
/* initial block size */
size_t
total_alloc
;
unsigned
int
block_num
;
/* allocated blocks counter */
/*
first free block in queue test counter (if it exceed
...
...
mysys/my_alloc.c
View file @
361a11de
...
...
@@ -73,7 +73,6 @@ void init_alloc_root(MEM_ROOT *mem_root, const char *name, size_t block_size,
mem_root
->
error_handler
=
0
;
mem_root
->
block_num
=
4
;
/* We shift this with >>2 */
mem_root
->
first_block_usage
=
0
;
mem_root
->
total_alloc
=
0
;
mem_root
->
name
=
name
;
#if !(defined(HAVE_valgrind) && defined(EXTRA_DEBUG))
...
...
@@ -84,7 +83,6 @@ void init_alloc_root(MEM_ROOT *mem_root, const char *name, size_t block_size,
MYF
(
my_flags
))))
{
mem_root
->
free
->
size
=
pre_alloc_size
+
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
mem_root
->
total_alloc
=
pre_alloc_size
+
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
mem_root
->
free
->
left
=
pre_alloc_size
;
mem_root
->
free
->
next
=
0
;
TRASH_MEM
(
mem_root
->
free
);
...
...
@@ -142,7 +140,6 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
{
/* remove block from the list and free it */
*
prev
=
mem
->
next
;
mem_root
->
total_alloc
-=
mem
->
size
;
my_free
(
mem
);
}
else
...
...
@@ -153,7 +150,6 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
MYF
(
MALLOC_FLAG
(
mem_root
)))))
{
mem
->
size
=
size
;
mem_root
->
total_alloc
+=
size
;
mem
->
left
=
pre_alloc_size
;
mem
->
next
=
*
prev
;
*
prev
=
mem_root
->
pre_alloc
=
mem
;
...
...
@@ -257,7 +253,6 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
DBUG_RETURN
((
void
*
)
0
);
/* purecov: inspected */
}
mem_root
->
block_num
++
;
mem_root
->
total_alloc
+=
get_size
;
next
->
next
=
*
prev
;
next
->
size
=
get_size
;
next
->
left
=
get_size
-
ALIGN_SIZE
(
sizeof
(
USED_MEM
));
...
...
@@ -416,7 +411,6 @@ void free_root(MEM_ROOT *root, myf MyFlags)
old
=
next
;
next
=
next
->
next
;
if
(
old
!=
root
->
pre_alloc
)
{
root
->
total_alloc
-=
old
->
size
;
my_free
(
old
);
}
}
...
...
@@ -425,7 +419,6 @@ void free_root(MEM_ROOT *root, myf MyFlags)
old
=
next
;
next
=
next
->
next
;
if
(
old
!=
root
->
pre_alloc
)
{
root
->
total_alloc
-=
old
->
size
;
my_free
(
old
);
}
}
...
...
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