# include <sys/stat.h>
#endif
+#ifndef UNALIGNED_OK
+# include <malloc.h>
+#endif
+
#if defined(WIN32) || defined(__CYGWIN__)
# include <fcntl.h>
# include <io.h>
void *myalloc(void *q, unsigned n, unsigned m)
{
(void)q;
+#ifndef UNALIGNED_OK
+ return memalign(16, n * m);
+#else
return calloc(n, m);
+#endif
}
void myfree(void *q, void *p)
#ifdef WITH_GZFILEOP
# include "gzguts.h"
#endif
+#ifndef UNALIGNED_OK
+# include "malloc.h"
+#endif
const char * const z_errmsg[10] = {
(const char *)"need dictionary", /* Z_NEED_DICT 2 */
void ZLIB_INTERNAL *zcalloc (void *opaque, unsigned items, unsigned size)
{
(void)opaque;
+#ifndef UNALIGNED_OK
+ return memalign(16, items * size);
+#else
return sizeof(unsigned int) > 2 ? (void *)malloc(items * size) :
(void *)calloc(items, size);
+#endif
}
void ZLIB_INTERNAL zcfree (void *opaque, void *ptr)