Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
solverstack
ScalFMM
Commits
78a0ec5b
Commit
78a0ec5b
authored
Nov 12, 2012
by
BRAMAS Berenger
Browse files
makes functions inline
parent
cd1886a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Src/Utils/FMemUtils.hpp
View file @
78a0ec5b
...
@@ -26,7 +26,7 @@ namespace FMemUtils {
...
@@ -26,7 +26,7 @@ namespace FMemUtils {
static
const
FSize
MaxSize_t
=
UINT_MAX
;
//std::numeric_limits<std::size_t>::max();
static
const
FSize
MaxSize_t
=
UINT_MAX
;
//std::numeric_limits<std::size_t>::max();
/** memcpy */
/** memcpy */
void
*
memcpy
(
void
*
const
dest
,
const
void
*
const
source
,
const
FSize
nbBytes
){
inline
void
*
memcpy
(
void
*
const
dest
,
const
void
*
const
source
,
const
FSize
nbBytes
){
if
(
nbBytes
<
MaxSize_t
){
if
(
nbBytes
<
MaxSize_t
){
return
::
memcpy
(
dest
,
source
,
size_t
(
nbBytes
));
return
::
memcpy
(
dest
,
source
,
size_t
(
nbBytes
));
}
}
...
@@ -46,7 +46,7 @@ namespace FMemUtils {
...
@@ -46,7 +46,7 @@ namespace FMemUtils {
}
}
/** memset */
/** memset */
void
*
memset
(
void
*
const
dest
,
const
int
val
,
const
FSize
nbBytes
){
inline
void
*
memset
(
void
*
const
dest
,
const
int
val
,
const
FSize
nbBytes
){
if
(
nbBytes
<
MaxSize_t
){
if
(
nbBytes
<
MaxSize_t
){
return
::
memset
(
dest
,
val
,
size_t
(
nbBytes
));
return
::
memset
(
dest
,
val
,
size_t
(
nbBytes
));
}
}
...
@@ -65,7 +65,7 @@ namespace FMemUtils {
...
@@ -65,7 +65,7 @@ namespace FMemUtils {
/** copy all value from one vector to the other */
/** copy all value from one vector to the other */
template
<
class
TypeClass
>
template
<
class
TypeClass
>
void
copyall
(
TypeClass
*
dest
,
const
TypeClass
*
source
,
int
nbElements
){
inline
void
copyall
(
TypeClass
*
dest
,
const
TypeClass
*
source
,
int
nbElements
){
for
(;
0
<
nbElements
;
--
nbElements
){
for
(;
0
<
nbElements
;
--
nbElements
){
(
*
dest
++
)
=
(
*
source
++
);
(
*
dest
++
)
=
(
*
source
++
);
}
}
...
@@ -73,7 +73,7 @@ namespace FMemUtils {
...
@@ -73,7 +73,7 @@ namespace FMemUtils {
/** copy all value from one vector to the other */
/** copy all value from one vector to the other */
template
<
class
TypeClass
>
template
<
class
TypeClass
>
void
addall
(
TypeClass
*
dest
,
const
TypeClass
*
source
,
int
nbElements
){
inline
void
addall
(
TypeClass
*
dest
,
const
TypeClass
*
source
,
int
nbElements
){
for
(;
0
<
nbElements
;
--
nbElements
){
for
(;
0
<
nbElements
;
--
nbElements
){
(
*
dest
++
)
+=
(
*
source
++
);
(
*
dest
++
)
+=
(
*
source
++
);
}
}
...
@@ -81,7 +81,7 @@ namespace FMemUtils {
...
@@ -81,7 +81,7 @@ namespace FMemUtils {
/** copy all value from one vector to the other */
/** copy all value from one vector to the other */
template
<
class
TypeClass
>
template
<
class
TypeClass
>
void
setall
(
TypeClass
*
dest
,
const
TypeClass
&
source
,
int
nbElements
){
inline
void
setall
(
TypeClass
*
dest
,
const
TypeClass
&
source
,
int
nbElements
){
for
(;
0
<
nbElements
;
--
nbElements
){
for
(;
0
<
nbElements
;
--
nbElements
){
(
*
dest
++
)
=
source
;
(
*
dest
++
)
=
source
;
}
}
...
@@ -89,7 +89,7 @@ namespace FMemUtils {
...
@@ -89,7 +89,7 @@ namespace FMemUtils {
/** swap values from a and b*/
/** swap values from a and b*/
template
<
class
TypeClass
>
template
<
class
TypeClass
>
void
swap
(
TypeClass
&
a
,
TypeClass
&
b
){
inline
void
swap
(
TypeClass
&
a
,
TypeClass
&
b
){
TypeClass
c
(
a
);
TypeClass
c
(
a
);
a
=
b
;
a
=
b
;
b
=
c
;
b
=
c
;
...
@@ -97,7 +97,7 @@ namespace FMemUtils {
...
@@ -97,7 +97,7 @@ namespace FMemUtils {
/** Delete all */
/** Delete all */
template
<
class
TypeClass
>
template
<
class
TypeClass
>
void
DeleteAll
(
TypeClass
*
const
array
[],
const
int
size
){
inline
void
DeleteAll
(
TypeClass
*
const
array
[],
const
int
size
){
for
(
int
idx
=
0
;
idx
<
size
;
++
idx
){
for
(
int
idx
=
0
;
idx
<
size
;
++
idx
){
delete
[]
array
[
idx
];
delete
[]
array
[
idx
];
}
}
...
...
Write
Preview
Supports
Markdown
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