Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
9500343d
Commit
9500343d
authored
Jun 17, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/HugeAllocator: add "noexcept"
parent
ef053035
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
HugeAllocator.cxx
src/util/HugeAllocator.cxx
+2
-2
HugeAllocator.hxx
src/util/HugeAllocator.hxx
+6
-6
No files found.
src/util/HugeAllocator.cxx
View file @
9500343d
...
...
@@ -81,13 +81,13 @@ HugeAllocate(size_t size) throw(std::bad_alloc)
}
void
HugeFree
(
void
*
p
,
size_t
size
)
HugeFree
(
void
*
p
,
size_t
size
)
noexcept
{
munmap
(
p
,
AlignToPageSize
(
size
));
}
void
HugeDiscard
(
void
*
p
,
size_t
size
)
HugeDiscard
(
void
*
p
,
size_t
size
)
noexcept
{
#ifdef MADV_DONTNEED
madvise
(
p
,
AlignToPageSize
(
size
),
MADV_DONTNEED
);
...
...
src/util/HugeAllocator.hxx
View file @
9500343d
...
...
@@ -52,7 +52,7 @@ HugeAllocate(size_t size) throw(std::bad_alloc);
* @param size the allocation's size as passed to HugeAllocate()
*/
void
HugeFree
(
void
*
p
,
size_t
size
);
HugeFree
(
void
*
p
,
size_t
size
)
noexcept
;
/**
* Discard any data stored in the allocation and give the memory back
...
...
@@ -63,7 +63,7 @@ HugeFree(void *p, size_t size);
* @param size the allocation's size as passed to HugeAllocate()
*/
void
HugeDiscard
(
void
*
p
,
size_t
size
);
HugeDiscard
(
void
*
p
,
size_t
size
)
noexcept
;
#elif defined(WIN32)
#include <windows.h>
...
...
@@ -73,13 +73,13 @@ void *
HugeAllocate
(
size_t
size
)
throw
(
std
::
bad_alloc
);
static
inline
void
HugeFree
(
void
*
p
,
gcc_unused
size_t
size
)
HugeFree
(
void
*
p
,
gcc_unused
size_t
size
)
noexcept
{
VirtualFree
(
p
,
0
,
MEM_RELEASE
);
}
static
inline
void
HugeDiscard
(
void
*
p
,
size_t
size
)
HugeDiscard
(
void
*
p
,
size_t
size
)
noexcept
{
VirtualAlloc
(
p
,
size
,
MEM_RESET
,
PAGE_NOACCESS
);
}
...
...
@@ -98,14 +98,14 @@ HugeAllocate(size_t size) throw(std::bad_alloc)
}
static
inline
void
HugeFree
(
void
*
_p
,
size_t
)
HugeFree
(
void
*
_p
,
size_t
)
noexcept
{
auto
*
p
=
(
uint8_t
*
)
_p
;
delete
[]
p
;
}
static
inline
void
HugeDiscard
(
void
*
,
size_t
)
HugeDiscard
(
void
*
,
size_t
)
noexcept
{
}
...
...
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