@img/sharp-libvips-dev-wasm32 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/include/aom/aom_decoder.h +1 -1
- package/include/aom/aom_encoder.h +7 -1
- package/include/aom/aom_image.h +24 -12
- package/include/aom/aom_integer.h +3 -3
- package/include/aom/aomcx.h +15 -0
- package/include/aom/aomdx.h +5 -2
- package/include/cgif.h +3 -0
- package/include/glib-2.0/gio/gappinfo.h +40 -25
- package/include/glib-2.0/gio/gasyncresult.h +1 -1
- package/include/glib-2.0/gio/gconverter.h +5 -0
- package/include/glib-2.0/gio/gdbusintrospection.h +1 -1
- package/include/glib-2.0/gio/gfile.h +16 -0
- package/include/glib-2.0/gio/gio-visibility.h +34 -0
- package/include/glib-2.0/gio/gsettings.h +8 -0
- package/include/glib-2.0/gio/gvfs.h +2 -2
- package/include/glib-2.0/glib/gbookmarkfile.h +1 -1
- package/include/glib-2.0/glib/giochannel.h +2 -2
- package/include/glib-2.0/glib/glib-visibility.h +34 -0
- package/include/glib-2.0/glib/gmacros.h +12 -5
- package/include/glib-2.0/glib/gmain.h +93 -7
- package/include/glib-2.0/glib/gqsort.h +8 -1
- package/include/glib-2.0/glib/gstrfuncs.h +0 -12
- package/include/glib-2.0/glib/gstrvbuilder.h +3 -0
- package/include/glib-2.0/glib/gunicode.h +1 -1
- package/include/glib-2.0/glib/gversionmacros.h +9 -0
- package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
- package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
- package/include/glib-2.0/gobject/gtype.h +6 -6
- package/include/hwy/abort.h +28 -0
- package/include/hwy/aligned_allocator.h +48 -1
- package/include/hwy/base.h +235 -34
- package/include/hwy/detect_compiler_arch.h +84 -10
- package/include/hwy/detect_targets.h +95 -29
- package/include/hwy/foreach_target.h +12 -1
- package/include/hwy/highway.h +205 -50
- package/include/hwy/ops/arm_neon-inl.h +841 -99
- package/include/hwy/ops/arm_sve-inl.h +413 -141
- package/include/hwy/ops/emu128-inl.h +373 -360
- package/include/hwy/ops/generic_ops-inl.h +804 -401
- package/include/hwy/ops/inside-inl.h +691 -0
- package/include/hwy/ops/ppc_vsx-inl.h +456 -166
- package/include/hwy/ops/rvv-inl.h +537 -249
- package/include/hwy/ops/scalar-inl.h +169 -79
- package/include/hwy/ops/set_macros-inl.h +106 -18
- package/include/hwy/ops/shared-inl.h +23 -0
- package/include/hwy/ops/wasm_128-inl.h +130 -108
- package/include/hwy/ops/x86_128-inl.h +1892 -577
- package/include/hwy/ops/x86_256-inl.h +625 -184
- package/include/hwy/ops/x86_512-inl.h +733 -131
- package/include/hwy/targets.h +22 -21
- package/include/hwy/timer-inl.h +3 -3
- package/include/hwy/timer.h +5 -1
- package/include/libheif/heif.h +170 -15
- package/include/libheif/heif_items.h +237 -0
- package/include/libheif/heif_properties.h +38 -2
- package/include/libheif/heif_regions.h +1 -1
- package/include/libheif/heif_version.h +2 -2
- package/include/resvg.h +2 -12
- package/include/vips/util.h +1 -2
- package/include/vips/version.h +4 -4
- package/include/webp/decode.h +58 -56
- package/include/webp/demux.h +25 -21
- package/include/webp/encode.h +44 -39
- package/include/webp/mux.h +76 -15
- package/include/webp/mux_types.h +2 -1
- package/include/webp/sharpyuv/sharpyuv.h +77 -8
- package/include/webp/types.h +29 -8
- package/include/zconf.h +1 -1
- package/include/zlib.h +12 -12
- package/lib/glib-2.0/include/glibconfig.h +2 -2
- package/lib/libaom.a +0 -0
- package/lib/libcgif.a +0 -0
- package/lib/libexif.a +0 -0
- package/lib/libexpat.a +0 -0
- package/lib/libffi.a +0 -0
- package/lib/libgio-2.0.a +0 -0
- package/lib/libglib-2.0.a +0 -0
- package/lib/libgmodule-2.0.a +0 -0
- package/lib/libgobject-2.0.a +0 -0
- package/lib/libgthread-2.0.a +0 -0
- package/lib/libheif.a +0 -0
- package/lib/libhwy.a +0 -0
- package/lib/libimagequant.a +0 -0
- package/lib/libjpeg.a +0 -0
- package/lib/liblcms2.a +0 -0
- package/lib/libresvg.a +0 -0
- package/lib/libsharpyuv.a +0 -0
- package/lib/libsharpyuv.la +4 -4
- package/lib/libspng.a +0 -0
- package/lib/libtiff.a +0 -0
- package/lib/libvips-cpp.a +0 -0
- package/lib/libvips.a +0 -0
- package/lib/libwebp.a +0 -0
- package/lib/libwebp.la +2 -2
- package/lib/libwebpdemux.a +0 -0
- package/lib/libwebpdemux.la +2 -2
- package/lib/libwebpmux.a +0 -0
- package/lib/libwebpmux.la +4 -4
- package/lib/libz.a +0 -0
- package/lib/pkgconfig/aom.pc +2 -2
- package/lib/pkgconfig/cgif.pc +1 -1
- package/lib/pkgconfig/gio-2.0.pc +1 -1
- package/lib/pkgconfig/glib-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-export-2.0.pc +1 -1
- package/lib/pkgconfig/gmodule-no-export-2.0.pc +1 -1
- package/lib/pkgconfig/gobject-2.0.pc +1 -1
- package/lib/pkgconfig/gthread-2.0.pc +1 -1
- package/lib/pkgconfig/libheif.pc +1 -10
- package/lib/pkgconfig/libhwy.pc +1 -1
- package/lib/pkgconfig/libsharpyuv.pc +1 -1
- package/lib/pkgconfig/libwebp.pc +1 -1
- package/lib/pkgconfig/libwebpdemux.pc +1 -1
- package/lib/pkgconfig/libwebpmux.pc +1 -1
- package/lib/pkgconfig/vips-cpp.pc +1 -1
- package/lib/pkgconfig/vips.pc +1 -1
- package/lib/pkgconfig/zlib.pc +1 -1
- package/package.json +1 -1
- package/versions.json +10 -10
|
@@ -35,13 +35,20 @@
|
|
|
35
35
|
|
|
36
36
|
G_BEGIN_DECLS
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
GLIB_DEPRECATED_IN_2_82_FOR(g_sort_array)
|
|
39
39
|
void g_qsort_with_data (gconstpointer pbase,
|
|
40
40
|
gint total_elems,
|
|
41
41
|
gsize size,
|
|
42
42
|
GCompareDataFunc compare_func,
|
|
43
43
|
gpointer user_data);
|
|
44
44
|
|
|
45
|
+
GLIB_AVAILABLE_IN_2_82
|
|
46
|
+
void g_sort_array (const void *array,
|
|
47
|
+
size_t n_elements,
|
|
48
|
+
size_t element_size,
|
|
49
|
+
GCompareDataFunc compare_func,
|
|
50
|
+
void *user_data);
|
|
51
|
+
|
|
45
52
|
G_END_DECLS
|
|
46
53
|
|
|
47
54
|
#endif /* __G_QSORT_H__ */
|
|
@@ -327,21 +327,9 @@ g_strdup_inline (const char *str)
|
|
|
327
327
|
#endif /* !defined (__GTK_DOC_IGNORE__) */
|
|
328
328
|
#endif /* G_GNUC_CHECK_VERSION (2, 0) */
|
|
329
329
|
|
|
330
|
-
/* Make a copy of a string interpreting C string -style escape
|
|
331
|
-
* sequences. Inverse of g_strescape. The recognized sequences are \b
|
|
332
|
-
* \f \n \r \t \\ \" and the octal format.
|
|
333
|
-
*/
|
|
334
330
|
GLIB_AVAILABLE_IN_ALL
|
|
335
331
|
gchar* g_strcompress (const gchar *source) G_GNUC_MALLOC;
|
|
336
332
|
|
|
337
|
-
/* Copy a string escaping nonprintable characters like in C strings.
|
|
338
|
-
* Inverse of g_strcompress. The exceptions parameter, if non-NULL, points
|
|
339
|
-
* to a string containing characters that are not to be escaped.
|
|
340
|
-
*
|
|
341
|
-
* Deprecated API: gchar* g_strescape (const gchar *source);
|
|
342
|
-
* Luckily this function wasn't used much, using NULL as second parameter
|
|
343
|
-
* provides mostly identical semantics.
|
|
344
|
-
*/
|
|
345
333
|
GLIB_AVAILABLE_IN_ALL
|
|
346
334
|
gchar* g_strescape (const gchar *source,
|
|
347
335
|
const gchar *exceptions) G_GNUC_MALLOC;
|
|
@@ -38,6 +38,9 @@ GStrvBuilder *g_strv_builder_new (void);
|
|
|
38
38
|
GLIB_AVAILABLE_IN_2_68
|
|
39
39
|
void g_strv_builder_unref (GStrvBuilder *builder);
|
|
40
40
|
|
|
41
|
+
GLIB_AVAILABLE_IN_2_82
|
|
42
|
+
GStrv g_strv_builder_unref_to_strv (GStrvBuilder *builder);
|
|
43
|
+
|
|
41
44
|
GLIB_AVAILABLE_IN_2_68
|
|
42
45
|
GStrvBuilder *g_strv_builder_ref (GStrvBuilder *builder);
|
|
43
46
|
|
|
@@ -806,7 +806,7 @@ GLIB_VAR const gchar * const g_utf8_skip;
|
|
|
806
806
|
* Before using this macro, use g_utf8_validate() to validate strings
|
|
807
807
|
* that may contain invalid UTF-8.
|
|
808
808
|
*/
|
|
809
|
-
#define g_utf8_next_char(p) (
|
|
809
|
+
#define g_utf8_next_char(p) ((p) + g_utf8_skip[*(const guchar *)(p)])
|
|
810
810
|
|
|
811
811
|
GLIB_AVAILABLE_IN_ALL
|
|
812
812
|
gunichar g_utf8_get_char (const gchar *p) G_GNUC_PURE;
|
|
@@ -395,6 +395,15 @@
|
|
|
395
395
|
* Since: 2.80
|
|
396
396
|
*/
|
|
397
397
|
#define GLIB_VERSION_2_80 (G_ENCODE_VERSION (2, 80))
|
|
398
|
+
/**
|
|
399
|
+
* GLIB_VERSION_2_82:
|
|
400
|
+
*
|
|
401
|
+
* A macro that evaluates to the 2.82 version of GLib, in a format
|
|
402
|
+
* that can be used by the C pre-processor.
|
|
403
|
+
*
|
|
404
|
+
* Since: 2.82
|
|
405
|
+
*/
|
|
406
|
+
#define GLIB_VERSION_2_82 (G_ENCODE_VERSION (2, 82))
|
|
398
407
|
|
|
399
408
|
/**
|
|
400
409
|
* GLIB_VERSION_CUR_STABLE:
|
|
@@ -984,3 +984,37 @@
|
|
|
984
984
|
#define GMODULE_AVAILABLE_ENUMERATOR_IN_2_80
|
|
985
985
|
#define GMODULE_AVAILABLE_TYPE_IN_2_80
|
|
986
986
|
#endif
|
|
987
|
+
|
|
988
|
+
#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_82
|
|
989
|
+
#define GMODULE_DEPRECATED_IN_2_82 GMODULE_DEPRECATED
|
|
990
|
+
#define GMODULE_DEPRECATED_IN_2_82_FOR(f) GMODULE_DEPRECATED_FOR (f)
|
|
991
|
+
#define GMODULE_DEPRECATED_MACRO_IN_2_82 GLIB_DEPRECATED_MACRO
|
|
992
|
+
#define GMODULE_DEPRECATED_MACRO_IN_2_82_FOR(f) GLIB_DEPRECATED_MACRO_FOR (f)
|
|
993
|
+
#define GMODULE_DEPRECATED_ENUMERATOR_IN_2_82 GLIB_DEPRECATED_ENUMERATOR
|
|
994
|
+
#define GMODULE_DEPRECATED_ENUMERATOR_IN_2_82_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR (f)
|
|
995
|
+
#define GMODULE_DEPRECATED_TYPE_IN_2_82 GLIB_DEPRECATED_TYPE
|
|
996
|
+
#define GMODULE_DEPRECATED_TYPE_IN_2_82_FOR(f) GLIB_DEPRECATED_TYPE_FOR (f)
|
|
997
|
+
#else
|
|
998
|
+
#define GMODULE_DEPRECATED_IN_2_82 _GMODULE_EXTERN
|
|
999
|
+
#define GMODULE_DEPRECATED_IN_2_82_FOR(f) _GMODULE_EXTERN
|
|
1000
|
+
#define GMODULE_DEPRECATED_MACRO_IN_2_82
|
|
1001
|
+
#define GMODULE_DEPRECATED_MACRO_IN_2_82_FOR(f)
|
|
1002
|
+
#define GMODULE_DEPRECATED_ENUMERATOR_IN_2_82
|
|
1003
|
+
#define GMODULE_DEPRECATED_ENUMERATOR_IN_2_82_FOR(f)
|
|
1004
|
+
#define GMODULE_DEPRECATED_TYPE_IN_2_82
|
|
1005
|
+
#define GMODULE_DEPRECATED_TYPE_IN_2_82_FOR(f)
|
|
1006
|
+
#endif
|
|
1007
|
+
|
|
1008
|
+
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_82
|
|
1009
|
+
#define GMODULE_AVAILABLE_IN_2_82 GMODULE_UNAVAILABLE (2, 82)
|
|
1010
|
+
#define GMODULE_AVAILABLE_STATIC_INLINE_IN_2_82 GLIB_UNAVAILABLE_STATIC_INLINE (2, 82)
|
|
1011
|
+
#define GMODULE_AVAILABLE_MACRO_IN_2_82 GLIB_UNAVAILABLE_MACRO (2, 82)
|
|
1012
|
+
#define GMODULE_AVAILABLE_ENUMERATOR_IN_2_82 GLIB_UNAVAILABLE_ENUMERATOR (2, 82)
|
|
1013
|
+
#define GMODULE_AVAILABLE_TYPE_IN_2_82 GLIB_UNAVAILABLE_TYPE (2, 82)
|
|
1014
|
+
#else
|
|
1015
|
+
#define GMODULE_AVAILABLE_IN_2_82 _GMODULE_EXTERN
|
|
1016
|
+
#define GMODULE_AVAILABLE_STATIC_INLINE_IN_2_82
|
|
1017
|
+
#define GMODULE_AVAILABLE_MACRO_IN_2_82
|
|
1018
|
+
#define GMODULE_AVAILABLE_ENUMERATOR_IN_2_82
|
|
1019
|
+
#define GMODULE_AVAILABLE_TYPE_IN_2_82
|
|
1020
|
+
#endif
|
|
@@ -984,3 +984,37 @@
|
|
|
984
984
|
#define GOBJECT_AVAILABLE_ENUMERATOR_IN_2_80
|
|
985
985
|
#define GOBJECT_AVAILABLE_TYPE_IN_2_80
|
|
986
986
|
#endif
|
|
987
|
+
|
|
988
|
+
#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_82
|
|
989
|
+
#define GOBJECT_DEPRECATED_IN_2_82 GOBJECT_DEPRECATED
|
|
990
|
+
#define GOBJECT_DEPRECATED_IN_2_82_FOR(f) GOBJECT_DEPRECATED_FOR (f)
|
|
991
|
+
#define GOBJECT_DEPRECATED_MACRO_IN_2_82 GLIB_DEPRECATED_MACRO
|
|
992
|
+
#define GOBJECT_DEPRECATED_MACRO_IN_2_82_FOR(f) GLIB_DEPRECATED_MACRO_FOR (f)
|
|
993
|
+
#define GOBJECT_DEPRECATED_ENUMERATOR_IN_2_82 GLIB_DEPRECATED_ENUMERATOR
|
|
994
|
+
#define GOBJECT_DEPRECATED_ENUMERATOR_IN_2_82_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR (f)
|
|
995
|
+
#define GOBJECT_DEPRECATED_TYPE_IN_2_82 GLIB_DEPRECATED_TYPE
|
|
996
|
+
#define GOBJECT_DEPRECATED_TYPE_IN_2_82_FOR(f) GLIB_DEPRECATED_TYPE_FOR (f)
|
|
997
|
+
#else
|
|
998
|
+
#define GOBJECT_DEPRECATED_IN_2_82 _GOBJECT_EXTERN
|
|
999
|
+
#define GOBJECT_DEPRECATED_IN_2_82_FOR(f) _GOBJECT_EXTERN
|
|
1000
|
+
#define GOBJECT_DEPRECATED_MACRO_IN_2_82
|
|
1001
|
+
#define GOBJECT_DEPRECATED_MACRO_IN_2_82_FOR(f)
|
|
1002
|
+
#define GOBJECT_DEPRECATED_ENUMERATOR_IN_2_82
|
|
1003
|
+
#define GOBJECT_DEPRECATED_ENUMERATOR_IN_2_82_FOR(f)
|
|
1004
|
+
#define GOBJECT_DEPRECATED_TYPE_IN_2_82
|
|
1005
|
+
#define GOBJECT_DEPRECATED_TYPE_IN_2_82_FOR(f)
|
|
1006
|
+
#endif
|
|
1007
|
+
|
|
1008
|
+
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_82
|
|
1009
|
+
#define GOBJECT_AVAILABLE_IN_2_82 GOBJECT_UNAVAILABLE (2, 82)
|
|
1010
|
+
#define GOBJECT_AVAILABLE_STATIC_INLINE_IN_2_82 GLIB_UNAVAILABLE_STATIC_INLINE (2, 82)
|
|
1011
|
+
#define GOBJECT_AVAILABLE_MACRO_IN_2_82 GLIB_UNAVAILABLE_MACRO (2, 82)
|
|
1012
|
+
#define GOBJECT_AVAILABLE_ENUMERATOR_IN_2_82 GLIB_UNAVAILABLE_ENUMERATOR (2, 82)
|
|
1013
|
+
#define GOBJECT_AVAILABLE_TYPE_IN_2_82 GLIB_UNAVAILABLE_TYPE (2, 82)
|
|
1014
|
+
#else
|
|
1015
|
+
#define GOBJECT_AVAILABLE_IN_2_82 _GOBJECT_EXTERN
|
|
1016
|
+
#define GOBJECT_AVAILABLE_STATIC_INLINE_IN_2_82
|
|
1017
|
+
#define GOBJECT_AVAILABLE_MACRO_IN_2_82
|
|
1018
|
+
#define GOBJECT_AVAILABLE_ENUMERATOR_IN_2_82
|
|
1019
|
+
#define GOBJECT_AVAILABLE_TYPE_IN_2_82
|
|
1020
|
+
#endif
|
|
@@ -1095,7 +1095,7 @@ typedef enum /*< skip >*/
|
|
|
1095
1095
|
* @base_finalize: Location of the base finalization function (optional)
|
|
1096
1096
|
* @class_init: Location of the class initialization function for
|
|
1097
1097
|
* classed and instantiatable types. Location of the default vtable
|
|
1098
|
-
*
|
|
1098
|
+
* initialization function for interface types. (optional) This function
|
|
1099
1099
|
* is used both to fill in virtual functions in the class or default vtable,
|
|
1100
1100
|
* and to do type-specific setup such as registering signals and object
|
|
1101
1101
|
* properties.
|
|
@@ -2280,7 +2280,7 @@ static void type_name##_class_intern_init (gpointer klass, \
|
|
|
2280
2280
|
#endif /* GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_80 */
|
|
2281
2281
|
|
|
2282
2282
|
/* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
|
|
2283
|
-
#define _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name
|
|
2283
|
+
#define _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name) \
|
|
2284
2284
|
\
|
|
2285
2285
|
static void type_name##_init (TypeName *self); \
|
|
2286
2286
|
static void type_name##_class_init (TypeName##Class *klass); \
|
|
@@ -2337,12 +2337,12 @@ type_name##_get_type_once (void) \
|
|
|
2337
2337
|
return g_define_type_id; \
|
|
2338
2338
|
} /* closes type_name##_get_type_once() */
|
|
2339
2339
|
|
|
2340
|
-
/* This was defined before we had
|
|
2341
|
-
* to keep it.
|
|
2340
|
+
/* This was defined before we had _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE in
|
|
2341
|
+
* gtype-private.h, it's simplest to keep it.
|
|
2342
2342
|
*/
|
|
2343
2343
|
#define _G_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PARENT, flags) \
|
|
2344
|
-
_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name
|
|
2345
|
-
_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags)
|
|
2344
|
+
_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE (TypeName, type_name) \
|
|
2345
|
+
_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER (TypeName, type_name, TYPE_PARENT, flags)
|
|
2346
2346
|
|
|
2347
2347
|
/* Intentionally using (GTypeFlags) 0 instead of G_TYPE_FLAG_NONE here,
|
|
2348
2348
|
* to avoid deprecation warnings with older GLIB_VERSION_MAX_ALLOWED */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
+
|
|
5
|
+
#ifndef HIGHWAY_HWY_ABORT_H_
|
|
6
|
+
#define HIGHWAY_HWY_ABORT_H_
|
|
7
|
+
|
|
8
|
+
#include "hwy/highway_export.h"
|
|
9
|
+
|
|
10
|
+
namespace hwy {
|
|
11
|
+
|
|
12
|
+
// Interface for custom abort handler
|
|
13
|
+
typedef void (*AbortFunc)(const char* file, int line,
|
|
14
|
+
const char* formatted_err);
|
|
15
|
+
|
|
16
|
+
// Retrieve current abort handler
|
|
17
|
+
// Returns null if no abort handler registered, indicating Highway should print and abort
|
|
18
|
+
HWY_DLLEXPORT AbortFunc& GetAbortFunc();
|
|
19
|
+
|
|
20
|
+
// Sets a new abort handler and returns the previous abort handler
|
|
21
|
+
// If this handler does not do the aborting itself Highway will use its own abort mechanism
|
|
22
|
+
// which allows this to be used to customize the handling of the error itself.
|
|
23
|
+
// Returns null if no previous abort handler registered
|
|
24
|
+
HWY_DLLEXPORT AbortFunc SetAbortFunc(AbortFunc func);
|
|
25
|
+
|
|
26
|
+
} // namespace hwy
|
|
27
|
+
|
|
28
|
+
#endif // HIGHWAY_HWY_ABORT_H_
|
|
@@ -21,11 +21,13 @@
|
|
|
21
21
|
#include <algorithm>
|
|
22
22
|
#include <array>
|
|
23
23
|
#include <cassert>
|
|
24
|
+
#include <cstdint>
|
|
24
25
|
#include <cstring>
|
|
25
26
|
#include <initializer_list>
|
|
26
27
|
#include <memory>
|
|
27
28
|
#include <type_traits>
|
|
28
29
|
#include <utility>
|
|
30
|
+
#include <vector>
|
|
29
31
|
|
|
30
32
|
#include "hwy/base.h"
|
|
31
33
|
#include "hwy/per_target.h"
|
|
@@ -35,9 +37,14 @@ namespace hwy {
|
|
|
35
37
|
// Minimum alignment of allocated memory for use in HWY_ASSUME_ALIGNED, which
|
|
36
38
|
// requires a literal. To prevent false sharing, this should be at least the
|
|
37
39
|
// L1 cache line size, usually 64 bytes. However, Intel's L2 prefetchers may
|
|
38
|
-
// access pairs of lines, and POWER8 also
|
|
40
|
+
// access pairs of lines, and M1 L2 and POWER8 lines are also 128 bytes.
|
|
39
41
|
#define HWY_ALIGNMENT 128
|
|
40
42
|
|
|
43
|
+
template <typename T>
|
|
44
|
+
HWY_API constexpr bool IsAligned(T* ptr, size_t align = HWY_ALIGNMENT) {
|
|
45
|
+
return reinterpret_cast<uintptr_t>(ptr) % align == 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
// Pointers to functions equivalent to malloc/free with an opaque void* passed
|
|
42
49
|
// to them.
|
|
43
50
|
using AllocPtr = void* (*)(void* opaque, size_t bytes);
|
|
@@ -124,6 +131,46 @@ AlignedUniquePtr<T> MakeUniqueAligned(Args&&... args) {
|
|
|
124
131
|
AlignedDeleter());
|
|
125
132
|
}
|
|
126
133
|
|
|
134
|
+
template <class T>
|
|
135
|
+
struct AlignedAllocator {
|
|
136
|
+
using value_type = T;
|
|
137
|
+
|
|
138
|
+
AlignedAllocator() = default;
|
|
139
|
+
|
|
140
|
+
template <class V>
|
|
141
|
+
explicit AlignedAllocator(const AlignedAllocator<V>&) noexcept {}
|
|
142
|
+
|
|
143
|
+
template <class V>
|
|
144
|
+
value_type* allocate(V n) {
|
|
145
|
+
static_assert(std::is_integral<V>::value,
|
|
146
|
+
"AlignedAllocator only supports integer types");
|
|
147
|
+
static_assert(sizeof(V) <= sizeof(std::size_t),
|
|
148
|
+
"V n must be smaller or equal size_t to avoid overflow");
|
|
149
|
+
return static_cast<value_type*>(
|
|
150
|
+
AllocateAlignedBytes(static_cast<std::size_t>(n) * sizeof(value_type)));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
template <class V>
|
|
154
|
+
void deallocate(value_type* p, HWY_MAYBE_UNUSED V n) {
|
|
155
|
+
return FreeAlignedBytes(p, nullptr, nullptr);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
template <class T, class V>
|
|
160
|
+
constexpr bool operator==(const AlignedAllocator<T>&,
|
|
161
|
+
const AlignedAllocator<V>&) noexcept {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
template <class T, class V>
|
|
166
|
+
constexpr bool operator!=(const AlignedAllocator<T>&,
|
|
167
|
+
const AlignedAllocator<V>&) noexcept {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
template <class T>
|
|
172
|
+
using AlignedVector = std::vector<T, AlignedAllocator<T>>;
|
|
173
|
+
|
|
127
174
|
// Helpers for array allocators (avoids overflow)
|
|
128
175
|
namespace detail {
|
|
129
176
|
|