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
Show 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(
...
@@ -109,6 +109,7 @@ os_mem_alloc_large(
if
(
ptr
)
{
if
(
ptr
)
{
*
n
=
size
;
*
n
=
size
;
ut_total_allocated_memory
+=
size
;
# ifdef UNIV_SET_MEM_TO_ZERO
# ifdef UNIV_SET_MEM_TO_ZERO
memset
(
ptr
,
'\0'
,
size
);
memset
(
ptr
,
'\0'
,
size
);
# endif
# endif
...
@@ -133,8 +134,9 @@ skip:
...
@@ -133,8 +134,9 @@ skip:
fprintf
(
stderr
,
"InnoDB: VirtualAlloc(%lu bytes) failed;"
fprintf
(
stderr
,
"InnoDB: VirtualAlloc(%lu bytes) failed;"
" Windows error %lu
\n
"
,
" Windows error %lu
\n
"
,
(
ulong
)
size
,
(
ulong
)
GetLastError
());
(
ulong
)
size
,
(
ulong
)
GetLastError
());
}
else
{
ut_total_allocated_memory
+=
size
;
}
}
#elif defined __NETWARE__ || !defined OS_MAP_ANON
#elif defined __NETWARE__ || !defined OS_MAP_ANON
size
=
*
n
;
size
=
*
n
;
ptr
=
ut_malloc_low
(
size
,
TRUE
,
FALSE
);
ptr
=
ut_malloc_low
(
size
,
TRUE
,
FALSE
);
...
@@ -153,6 +155,8 @@ skip:
...
@@ -153,6 +155,8 @@ skip:
" errno %lu
\n
"
,
" errno %lu
\n
"
,
(
ulong
)
size
,
(
ulong
)
errno
);
(
ulong
)
size
,
(
ulong
)
errno
);
ptr
=
NULL
;
ptr
=
NULL
;
}
else
{
ut_total_allocated_memory
+=
size
;
}
}
#endif
#endif
return
(
ptr
);
return
(
ptr
);
...
@@ -169,8 +173,11 @@ os_mem_free_large(
...
@@ -169,8 +173,11 @@ os_mem_free_large(
ulint
size
)
/* in: size returned by
ulint
size
)
/* in: size returned by
os_mem_alloc_large() */
os_mem_alloc_large() */
{
{
ut_a
(
ut_total_allocated_memory
>=
size
);
#if defined HAVE_LARGE_PAGES && defined UNIV_LINUX
#if defined HAVE_LARGE_PAGES && defined UNIV_LINUX
if
(
os_use_large_pages
&&
os_large_page_size
&&
!
shmdt
(
ptr
))
{
if
(
os_use_large_pages
&&
os_large_page_size
&&
!
shmdt
(
ptr
))
{
ut_total_allocated_memory
-=
size
;
return
;
return
;
}
}
#endif
/* HAVE_LARGE_PAGES && UNIV_LINUX */
#endif
/* HAVE_LARGE_PAGES && UNIV_LINUX */
...
@@ -179,6 +186,8 @@ os_mem_free_large(
...
@@ -179,6 +186,8 @@ os_mem_free_large(
fprintf
(
stderr
,
"InnoDB: VirtualFree(%p, %lu) failed;"
fprintf
(
stderr
,
"InnoDB: VirtualFree(%p, %lu) failed;"
" Windows error %lu
\n
"
,
" Windows error %lu
\n
"
,
ptr
,
(
ulong
)
size
,
(
ulong
)
GetLastError
());
ptr
,
(
ulong
)
size
,
(
ulong
)
GetLastError
());
}
else
{
ut_total_allocated_memory
-=
size
;
}
}
#elif defined __NETWARE__ || !defined OS_MAP_ANON
#elif defined __NETWARE__ || !defined OS_MAP_ANON
ut_free
(
ptr
);
ut_free
(
ptr
);
...
@@ -187,8 +196,9 @@ os_mem_free_large(
...
@@ -187,8 +196,9 @@ os_mem_free_large(
fprintf
(
stderr
,
"InnoDB: munmap(%p, %lu) failed;"
fprintf
(
stderr
,
"InnoDB: munmap(%p, %lu) failed;"
" errno %lu
\n
"
,
" errno %lu
\n
"
,
ptr
,
(
ulong
)
size
,
(
ulong
)
errno
);
ptr
,
(
ulong
)
size
,
(
ulong
)
errno
);
}
else
{
ut_total_allocated_memory
-=
size
;
}
}
#endif
#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