fix: breakpad use miniz
Some checks failed
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 1m34s
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Successful in 2m46s
sm-rpc / build (Debug, host.gcc) (push) Failing after 1m28s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Successful in 2m14s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Successful in 2m8s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Successful in 5m35s
sm-rpc / build (Release, host.gcc) (push) Failing after 1m55s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Successful in 7m21s
Some checks failed
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 1m34s
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Successful in 2m46s
sm-rpc / build (Debug, host.gcc) (push) Failing after 1m28s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Successful in 2m14s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Successful in 2m8s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Successful in 5m35s
sm-rpc / build (Release, host.gcc) (push) Failing after 1m55s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Successful in 7m21s
This commit is contained in:
46
third_party/zlib-ng/zutil_p.h
vendored
Normal file
46
third_party/zlib-ng/zutil_p.h
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/* zutil_p.h -- Private inline functions used internally in zlib-ng
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
#ifndef ZUTIL_P_H
|
||||
#define ZUTIL_P_H
|
||||
|
||||
#if defined(__APPLE__) || defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_ALIGNED_ALLOC)
|
||||
# include <stdlib.h>
|
||||
#elif defined(__FreeBSD__)
|
||||
# include <stdlib.h>
|
||||
# include <malloc_np.h>
|
||||
#else
|
||||
# include <malloc.h>
|
||||
#endif
|
||||
|
||||
/* Function to allocate 16 or 64-byte aligned memory */
|
||||
static inline void *zng_alloc(size_t size) {
|
||||
#ifdef HAVE_ALIGNED_ALLOC
|
||||
/* Size must be a multiple of alignment */
|
||||
size = (size + (64 - 1)) & ~(64 - 1);
|
||||
return (void *)aligned_alloc(64, size); /* Defined in C11 */
|
||||
#elif defined(HAVE_POSIX_MEMALIGN)
|
||||
void *ptr;
|
||||
return posix_memalign(&ptr, 64, size) ? NULL : ptr;
|
||||
#elif defined(_WIN32)
|
||||
return (void *)_aligned_malloc(size, 64);
|
||||
#elif defined(__APPLE__)
|
||||
/* Fallback for when posix_memalign and aligned_alloc are not available.
|
||||
* On macOS, it always aligns to 16 bytes. */
|
||||
return (void *)malloc(size);
|
||||
#else
|
||||
return (void *)memalign(64, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Function that can free aligned memory */
|
||||
static inline void zng_free(void *ptr) {
|
||||
#if defined(_WIN32)
|
||||
_aligned_free(ptr);
|
||||
#else
|
||||
free(ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user