@@ -22,6 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
-----------------------------------------------------------------------------------------------*/
23
23
#pragma once
24
24
25
+ #include < cppcore//CPPCoreCommon.h>
25
26
#include < string.h>
26
27
#include < cinttypes>
27
28
@@ -40,18 +41,30 @@ inline size_t align(size_t n) {
40
41
// /
41
42
// / @brief Utility class for common memory operations.
42
43
// -------------------------------------------------------------------------------------------------
43
- class MemUtils {
44
+ class DLL_CPPCORE_EXPORT MemUtils {
44
45
public:
45
46
// / @brief Will clear the given buffer with zero.
46
- // / @param buffer [inout] The buffer to clear.
47
+ // / @param[inout] buffer The buffer to clear.
47
48
static void clearMemory (void *buffer, size_t size);
48
49
50
+ // / @brief Will return true, if the pointer fits into the alignment.
51
+ // / @param[in] ptr The pointer to check.
52
+ // / @param[in] align The alignment to check for.
53
+ // / @return true if aligned, false if not.
49
54
static bool isAligned (const void *ptr, size_t align);
50
55
56
+ // / @brief Will align the given pointer.
57
+ // / @param[in] ptr The pointer to align.
58
+ // / @param[in] extra Space for headers / meta information.
59
+ // / @param[in] align The alignment to check for.
60
+ // / @return The aligned pointer.
51
61
static const void *alignPtr (void *ptr, size_t extra, size_t align);
52
62
53
- MemUtils () = delete ;
54
- ~MemUtils () = delete ;
63
+ // / @brief The default class constructor.
64
+ MemUtils () = default ;
65
+
66
+ // / @brief The class destructor.
67
+ ~MemUtils () = default ;
55
68
};
56
69
57
70
inline bool MemUtils::isAligned (const void *ptr, size_t align) {
0 commit comments