aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/mem_ops.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/mem_ops.h')
-rw-r--r--src/utils/mem_ops.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils/mem_ops.h b/src/utils/mem_ops.h
index f6557c744..0fcf34ba8 100644
--- a/src/utils/mem_ops.h
+++ b/src/utils/mem_ops.h
@@ -26,7 +26,14 @@ template<typename T> inline void set_mem(T* ptr, u32bit n, byte val)
{ std::memset(ptr, val, sizeof(T)*n); }
template<typename T> inline bool same_mem(const T* p1, const T* p2, u32bit n)
- { return (std::memcmp(p1, p2, sizeof(T)*n) == 0); }
+ {
+ bool is_same = true;
+
+ for(u32bit i = 0; i != n; ++i)
+ is_same &= (p1[i] == p2[i]);
+
+ return is_same;
+ }
}