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
c9b221e8
Commit
c9b221e8
authored
Jan 16, 2008
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: os_mem_alloc_large(), os_mem_free_large():
Update ut_total_allocated_memory.
parent
66791e5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
os/os0proc.c
os/os0proc.c
+12
-2
No files found.
os/os0proc.c
View file @
c9b221e8
...
...
@@ -109,6 +109,7 @@ os_mem_alloc_large(
if
(
ptr
)
{
*
n
=
size
;
ut_total_allocated_memory
+=
size
;
# ifdef UNIV_SET_MEM_TO_ZERO
memset
(
ptr
,
'\0'
,
size
);
# endif
...
...
@@ -133,8 +134,9 @@ skip:
fprintf
(
stderr
,
"InnoDB: VirtualAlloc(%lu bytes) failed;"
" Windows error %lu
\n
"
,
(
ulong
)
size
,
(
ulong
)
GetLastError
());
}
else
{
ut_total_allocated_memory
+=
size
;
}
#elif defined __NETWARE__ || !defined OS_MAP_ANON
size
=
*
n
;
ptr
=
ut_malloc_low
(
size
,
TRUE
,
FALSE
);
...
...
@@ -153,6 +155,8 @@ skip:
" errno %lu
\n
"
,
(
ulong
)
size
,
(
ulong
)
errno
);
ptr
=
NULL
;
}
else
{
ut_total_allocated_memory
+=
size
;
}
#endif
return
(
ptr
);
...
...
@@ -169,8 +173,11 @@ os_mem_free_large(
ulint
size
)
/* in: size returned by
os_mem_alloc_large() */
{
ut_a
(
ut_total_allocated_memory
>=
size
);
#if defined HAVE_LARGE_PAGES && defined UNIV_LINUX
if
(
os_use_large_pages
&&
os_large_page_size
&&
!
shmdt
(
ptr
))
{
ut_total_allocated_memory
-=
size
;
return
;
}
#endif
/* HAVE_LARGE_PAGES && UNIV_LINUX */
...
...
@@ -179,6 +186,8 @@ os_mem_free_large(
fprintf
(
stderr
,
"InnoDB: VirtualFree(%p, %lu) failed;"
" Windows error %lu
\n
"
,
ptr
,
(
ulong
)
size
,
(
ulong
)
GetLastError
());
}
else
{
ut_total_allocated_memory
-=
size
;
}
#elif defined __NETWARE__ || !defined OS_MAP_ANON
ut_free
(
ptr
);
...
...
@@ -187,8 +196,9 @@ os_mem_free_large(
fprintf
(
stderr
,
"InnoDB: munmap(%p, %lu) failed;"
" errno %lu
\n
"
,
ptr
,
(
ulong
)
size
,
(
ulong
)
errno
);
}
else
{
ut_total_allocated_memory
-=
size
;
}
#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