@@ -22,6 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222-----------------------------------------------------------------------------------------------*/
2323#pragma once
2424
25+ #include < cppcore//CPPCoreCommon.h>
2526#include < string.h>
2627#include < cinttypes>
2728
@@ -40,18 +41,30 @@ inline size_t align(size_t n) {
4041// /
4142// / @brief Utility class for common memory operations.
4243// -------------------------------------------------------------------------------------------------
43- class MemUtils {
44+ class DLL_CPPCORE_EXPORT MemUtils {
4445public:
4546 // / @brief Will clear the given buffer with zero.
46- // / @param buffer [inout] The buffer to clear.
47+ // / @param[inout] buffer The buffer to clear.
4748 static void clearMemory (void *buffer, size_t size);
4849
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.
4954 static bool isAligned (const void *ptr, size_t align);
5055
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.
5161 static const void *alignPtr (void *ptr, size_t extra, size_t align);
5262
53- MemUtils () = delete ;
54- ~MemUtils () = delete ;
63+ // / @brief The default class constructor.
64+ MemUtils () = default ;
65+
66+ // / @brief The class destructor.
67+ ~MemUtils () = default ;
5568};
5669
5770inline bool MemUtils::isAligned (const void *ptr, size_t align) {
0 commit comments