-/* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2015 Jay Freeman (saurik)
+/* Cycript - The Truly Universal Scripting Language
+ * Copyright (C) 2009-2016 Jay Freeman (saurik)
*/
/* GNU Affero General Public License, Version 3 {{{ */
return reinterpret_cast<Type_ *>(data);
}
+ template <typename Type_>
+ Type_ *calloc(size_t count, size_t size, size_t alignment = CYAlignment) {
+ Type_ *data(malloc<Type_>(count * size, alignment));
+ memset(data, 0, count * size);
+ return data;
+ }
+
char *strdup(const char *data) {
if (data == NULL)
return NULL;
- return reinterpret_cast<char *>(memdup(data, strlen(data) + 1));
+ return memdup(data, strlen(data) + 1, 1);
}
template <typename Type_>