void *Util_Memdup(const void *src, size_t size);
void *Util_Memcpy(void *dest, const void *src, size_t count);
+void Util_Memfree(void *ptr);
Bool Util_ConstTimeMemDiff(const void *secret, const void *guess, size_t len);
Bool Util_ConstTimeStrDiff(const char *secret, const char *guess);
* a parameter that no longer match the content of the dormant license
* file.
*/
-#define PRODUCT_MAC_DESKTOP_VERSION_STRING_FOR_LICENSE "10.0"
+#define PRODUCT_MAC_DESKTOP_VERSION_STRING_FOR_LICENSE "11.0"
#define PRODUCT_PLAYER_VERSION_STRING_FOR_LICENSE "14.0"
#define PRODUCT_VMRC_VERSION_STRING_FOR_LICENSE "10.0"
#define PRODUCT_FLEX_VERSION_STRING_FOR_LICENSE "8.0"
}
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * Util_Memfree --
+ *
+ * Frees the memory space pointed to by ptr.
+ *
+ * The reason why this function is externally visible (not static)
+ * is to avoid freeing memory across dll boundary.
+ * In vmwarebase, we have many API that return newly allocated memory
+ * to the caller. If the caller linked against a different msvc runtime
+ * (for example, vmrest linked against msvcrt.dll), we will crash.
+ * Using Util_Memfree() can avoid this kind of problem, since it sits
+ * inside vmwarebase too. It will call the right free(), the one that
+ * match the malloc() used in vmwarebase.
+ *
+ * Results:
+ * The memory space pointed to by ptr will be freed.
+ * If ptr is NULL, no operation is performed.
+ *
+ * Side effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+Util_Memfree(void *ptr) // IN:
+{
+ free(ptr);
+}
+
+
/*
*-----------------------------------------------------------------------------
*