@img/sharp-libvips-dev 1.0.1 → 1.0.3
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/README.md +1 -2
- 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/archive.h +7 -5
- package/include/archive_entry.h +5 -3
- package/include/cgif.h +3 -0
- package/include/expat.h +21 -10
- package/include/expat_config.h +11 -5
- package/include/ffi.h +12 -25
- package/include/freetype2/freetype/config/ftoption.h +2 -2
- package/include/fribidi/fribidi-config.h +2 -2
- package/include/fribidi/fribidi-unicode-version.h +3 -3
- package/include/gio-unix-2.0/gio/gfiledescriptorbased.h +3 -2
- package/include/glib-2.0/gio/gappinfo.h +40 -25
- package/include/glib-2.0/gio/gapplication.h +6 -0
- 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/giotypes.h +0 -1
- 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/girepository/gi-visibility.h +34 -0
- package/include/glib-2.0/girepository/giarginfo.h +23 -6
- package/include/glib-2.0/girepository/gibaseinfo.h +44 -18
- package/include/glib-2.0/girepository/gicallableinfo.h +26 -16
- package/include/glib-2.0/girepository/gicallbackinfo.h +17 -2
- package/include/glib-2.0/girepository/giconstantinfo.h +19 -4
- package/include/glib-2.0/girepository/gienuminfo.h +20 -21
- package/include/glib-2.0/girepository/gifieldinfo.h +22 -7
- package/include/glib-2.0/girepository/giflagsinfo.h +60 -0
- package/include/glib-2.0/girepository/gifunctioninfo.h +22 -7
- package/include/glib-2.0/girepository/giinterfaceinfo.h +33 -18
- package/include/glib-2.0/girepository/giobjectinfo.h +41 -26
- package/include/glib-2.0/girepository/gipropertyinfo.h +18 -3
- package/include/glib-2.0/girepository/giregisteredtypeinfo.h +22 -11
- package/include/glib-2.0/girepository/girepository-autocleanups.h +56 -0
- package/include/glib-2.0/girepository/girepository.h +53 -62
- package/include/glib-2.0/girepository/girffi.h +8 -7
- package/include/glib-2.0/girepository/gisignalinfo.h +18 -3
- package/include/glib-2.0/girepository/gistructinfo.h +26 -11
- package/include/glib-2.0/girepository/gitypeinfo.h +29 -16
- package/include/glib-2.0/girepository/gitypelib.h +9 -13
- package/include/glib-2.0/girepository/gitypes.h +52 -104
- package/include/glib-2.0/girepository/giunioninfo.h +28 -12
- package/include/glib-2.0/girepository/giunresolvedinfo.h +17 -2
- package/include/glib-2.0/girepository/givalueinfo.h +65 -0
- package/include/glib-2.0/girepository/givfuncinfo.h +23 -8
- package/include/glib-2.0/glib/deprecated/gthread.h +9 -5
- package/include/glib-2.0/glib/gbitlock.h +31 -0
- 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/gmessages.h +8 -0
- package/include/glib-2.0/glib/gqsort.h +8 -1
- package/include/glib-2.0/glib/gslice.h +2 -0
- package/include/glib-2.0/glib/gstrfuncs.h +24 -30
- package/include/glib-2.0/glib/gstrvbuilder.h +3 -0
- package/include/glib-2.0/glib/gthread.h +191 -3
- 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/glib-unix.h +7 -1
- package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
- package/include/glib-2.0/gobject/genums.h +6 -6
- package/include/glib-2.0/gobject/glib-types.h +11 -0
- package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
- package/include/glib-2.0/gobject/gsignal.h +16 -6
- package/include/glib-2.0/gobject/gtype.h +6 -6
- package/include/harfbuzz/hb-buffer.h +6 -0
- package/include/harfbuzz/hb-common.h +6 -9
- package/include/harfbuzz/hb-cplusplus.hh +8 -11
- package/include/harfbuzz/hb-subset.h +17 -4
- package/include/harfbuzz/hb-version.h +3 -3
- package/include/hwy/abort.h +28 -0
- package/include/hwy/aligned_allocator.h +218 -6
- package/include/hwy/base.h +1935 -512
- package/include/hwy/cache_control.h +24 -6
- package/include/hwy/detect_compiler_arch.h +105 -10
- package/include/hwy/detect_targets.h +146 -37
- package/include/hwy/foreach_target.h +36 -1
- package/include/hwy/highway.h +222 -50
- package/include/hwy/ops/arm_neon-inl.h +2055 -894
- package/include/hwy/ops/arm_sve-inl.h +1476 -348
- package/include/hwy/ops/emu128-inl.h +711 -623
- package/include/hwy/ops/generic_ops-inl.h +4431 -2157
- package/include/hwy/ops/inside-inl.h +691 -0
- package/include/hwy/ops/ppc_vsx-inl.h +2186 -673
- package/include/hwy/ops/rvv-inl.h +1556 -536
- package/include/hwy/ops/scalar-inl.h +353 -233
- package/include/hwy/ops/set_macros-inl.h +171 -23
- package/include/hwy/ops/shared-inl.h +198 -56
- package/include/hwy/ops/wasm_128-inl.h +283 -244
- package/include/hwy/ops/x86_128-inl.h +3673 -1357
- package/include/hwy/ops/x86_256-inl.h +1737 -663
- package/include/hwy/ops/x86_512-inl.h +1697 -500
- package/include/hwy/per_target.h +4 -0
- package/include/hwy/profiler.h +648 -0
- package/include/hwy/robust_statistics.h +2 -2
- package/include/hwy/targets.h +40 -32
- package/include/hwy/timer-inl.h +3 -3
- package/include/hwy/timer.h +16 -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/libpng16/png.h +32 -29
- package/include/libpng16/pngconf.h +2 -2
- package/include/libpng16/pnglibconf.h +8 -3
- package/include/librsvg-2.0/librsvg/rsvg-cairo.h +1 -1
- package/include/librsvg-2.0/librsvg/rsvg-features.h +3 -4
- package/include/librsvg-2.0/librsvg/rsvg-pixbuf.h +235 -0
- package/include/librsvg-2.0/librsvg/rsvg-version.h +3 -3
- package/include/librsvg-2.0/librsvg/rsvg.h +55 -176
- package/include/libxml2/libxml/HTMLparser.h +12 -19
- package/include/libxml2/libxml/c14n.h +1 -12
- package/include/libxml2/libxml/debugXML.h +1 -1
- package/include/libxml2/libxml/encoding.h +9 -0
- package/include/libxml2/libxml/entities.h +12 -1
- package/include/libxml2/libxml/hash.h +19 -0
- package/include/libxml2/libxml/list.h +2 -2
- package/include/libxml2/libxml/nanohttp.h +17 -0
- package/include/libxml2/libxml/parser.h +73 -58
- package/include/libxml2/libxml/parserInternals.h +9 -1
- package/include/libxml2/libxml/pattern.h +6 -0
- package/include/libxml2/libxml/tree.h +32 -12
- package/include/libxml2/libxml/uri.h +11 -0
- package/include/libxml2/libxml/valid.h +29 -2
- package/include/libxml2/libxml/xinclude.h +7 -0
- package/include/libxml2/libxml/xmlIO.h +21 -5
- package/include/libxml2/libxml/xmlerror.h +14 -0
- package/include/libxml2/libxml/xmlexports.h +111 -15
- package/include/libxml2/libxml/xmlmemory.h +8 -45
- package/include/libxml2/libxml/xmlreader.h +2 -0
- package/include/libxml2/libxml/xmlsave.h +5 -0
- package/include/libxml2/libxml/xmlunicode.h +165 -1
- package/include/libxml2/libxml/xmlversion.h +15 -179
- package/include/libxml2/libxml/xmlwriter.h +1 -0
- package/include/libxml2/libxml/xpath.h +4 -0
- package/include/pango-1.0/pango/pango-features.h +2 -2
- package/include/pango-1.0/pango/pango-fontmap.h +7 -0
- package/include/pango-1.0/pango/pango-item.h +4 -2
- package/include/pango-1.0/pango/pango-version-macros.h +25 -0
- package/include/pango-1.0/pango/pangofc-font.h +2 -1
- package/include/pixman-1/pixman-version.h +2 -2
- package/include/png.h +32 -29
- package/include/pngconf.h +2 -2
- package/include/pnglibconf.h +8 -3
- package/include/vips/connection.h +9 -3
- package/include/vips/util.h +1 -11
- 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/package.json +1 -1
- package/versions.json +18 -19
|
@@ -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
|
|
@@ -500,14 +500,18 @@ void g_signal_chain_from_overridden_handler (gpointer instance,
|
|
|
500
500
|
* @c_handler: the #GCallback to connect.
|
|
501
501
|
* @data: data to pass to @c_handler calls.
|
|
502
502
|
*
|
|
503
|
-
* Connects a
|
|
503
|
+
* Connects a [type@GObject.Callback] function to a signal for a particular object.
|
|
504
504
|
*
|
|
505
|
-
* The handler will be called synchronously, before the default handler of the signal.
|
|
505
|
+
* The handler will be called synchronously, before the default handler of the signal.
|
|
506
|
+
* [func@GObject.signal_emit] will not return control until all handlers are called.
|
|
506
507
|
*
|
|
507
|
-
* See [memory management of signal handlers]
|
|
508
|
+
* See [memory management of signal handlers](signals.html#Memory_management_of_signal_handlers) for
|
|
508
509
|
* details on how to handle the return value and memory management of @data.
|
|
509
510
|
*
|
|
510
|
-
*
|
|
511
|
+
* This function cannot fail. If the given signal doesn’t exist, a critical
|
|
512
|
+
* warning is emitted.
|
|
513
|
+
*
|
|
514
|
+
* Returns: the handler ID, of type `gulong` (always greater than 0)
|
|
511
515
|
*/
|
|
512
516
|
/* Intentionally not using G_CONNECT_DEFAULT here to avoid deprecation
|
|
513
517
|
* warnings with older GLIB_VERSION_MAX_ALLOWED */
|
|
@@ -524,7 +528,10 @@ void g_signal_chain_from_overridden_handler (gpointer instance,
|
|
|
524
528
|
*
|
|
525
529
|
* The handler will be called synchronously, after the default handler of the signal.
|
|
526
530
|
*
|
|
527
|
-
*
|
|
531
|
+
* This function cannot fail. If the given signal doesn’t exist, a critical
|
|
532
|
+
* warning is emitted.
|
|
533
|
+
*
|
|
534
|
+
* Returns: the handler ID, of type `gulong` (always greater than 0)
|
|
528
535
|
*/
|
|
529
536
|
#define g_signal_connect_after(instance, detailed_signal, c_handler, data) \
|
|
530
537
|
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_AFTER)
|
|
@@ -562,7 +569,10 @@ void g_signal_chain_from_overridden_handler (gpointer instance,
|
|
|
562
569
|
* (GCallback) button_clicked_cb, other_widget);
|
|
563
570
|
* ]|
|
|
564
571
|
*
|
|
565
|
-
*
|
|
572
|
+
* This function cannot fail. If the given signal doesn’t exist, a critical
|
|
573
|
+
* warning is emitted.
|
|
574
|
+
*
|
|
575
|
+
* Returns: the handler ID, of type `gulong` (always greater than 0)
|
|
566
576
|
*/
|
|
567
577
|
#define g_signal_connect_swapped(instance, detailed_signal, c_handler, data) \
|
|
568
578
|
g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_SWAPPED)
|
|
@@ -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.
|
|
@@ -2278,7 +2278,7 @@ static void type_name##_class_intern_init (gpointer klass) \
|
|
|
2278
2278
|
#endif /* GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_80 */
|
|
2279
2279
|
|
|
2280
2280
|
/* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
|
|
2281
|
-
#define _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name
|
|
2281
|
+
#define _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name) \
|
|
2282
2282
|
\
|
|
2283
2283
|
static void type_name##_init (TypeName *self); \
|
|
2284
2284
|
static void type_name##_class_init (TypeName##Class *klass); \
|
|
@@ -2330,12 +2330,12 @@ type_name##_get_type_once (void) \
|
|
|
2330
2330
|
return g_define_type_id; \
|
|
2331
2331
|
} /* closes type_name##_get_type_once() */
|
|
2332
2332
|
|
|
2333
|
-
/* This was defined before we had
|
|
2334
|
-
* to keep it.
|
|
2333
|
+
/* This was defined before we had _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE in
|
|
2334
|
+
* gtype-private.h, it's simplest to keep it.
|
|
2335
2335
|
*/
|
|
2336
2336
|
#define _G_DEFINE_TYPE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PARENT, flags) \
|
|
2337
|
-
_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name
|
|
2338
|
-
_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags)
|
|
2337
|
+
_G_DEFINE_TYPE_EXTENDED_BEGIN_PRE (TypeName, type_name) \
|
|
2338
|
+
_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER (TypeName, type_name, TYPE_PARENT, flags)
|
|
2339
2339
|
|
|
2340
2340
|
/* Intentionally using (GTypeFlags) 0 instead of G_TYPE_FLAG_NONE here,
|
|
2341
2341
|
* to avoid deprecation warnings with older GLIB_VERSION_MAX_ALLOWED */
|
|
@@ -487,6 +487,12 @@ hb_buffer_set_not_found_glyph (hb_buffer_t *buffer,
|
|
|
487
487
|
HB_EXTERN hb_codepoint_t
|
|
488
488
|
hb_buffer_get_not_found_glyph (const hb_buffer_t *buffer);
|
|
489
489
|
|
|
490
|
+
HB_EXTERN void
|
|
491
|
+
hb_buffer_set_random_state (hb_buffer_t *buffer,
|
|
492
|
+
unsigned state);
|
|
493
|
+
|
|
494
|
+
HB_EXTERN unsigned
|
|
495
|
+
hb_buffer_get_random_state (const hb_buffer_t *buffer);
|
|
490
496
|
|
|
491
497
|
/*
|
|
492
498
|
* Content API.
|
|
@@ -47,14 +47,10 @@
|
|
|
47
47
|
# endif /* !__cplusplus */
|
|
48
48
|
#endif
|
|
49
49
|
|
|
50
|
-
#if defined (
|
|
51
|
-
defined (_sgi) || defined (__sun) || defined (sun) || \
|
|
52
|
-
defined (__digital__) || defined (__HP_cc)
|
|
53
|
-
# include <inttypes.h>
|
|
54
|
-
#elif defined (_AIX)
|
|
50
|
+
#if defined (_AIX)
|
|
55
51
|
# include <sys/inttypes.h>
|
|
56
52
|
#elif defined (_MSC_VER) && _MSC_VER < 1600
|
|
57
|
-
/* VS 2010 (_MSC_VER 1600) has stdint.h
|
|
53
|
+
/* VS 2010 (_MSC_VER 1600) has stdint.h */
|
|
58
54
|
typedef __int8 int8_t;
|
|
59
55
|
typedef unsigned __int8 uint8_t;
|
|
60
56
|
typedef __int16 int16_t;
|
|
@@ -63,10 +59,11 @@ typedef __int32 int32_t;
|
|
|
63
59
|
typedef unsigned __int32 uint32_t;
|
|
64
60
|
typedef __int64 int64_t;
|
|
65
61
|
typedef unsigned __int64 uint64_t;
|
|
66
|
-
#elif defined (
|
|
67
|
-
|
|
68
|
-
#else
|
|
62
|
+
#elif defined (_MSC_VER) && _MSC_VER < 1800
|
|
63
|
+
/* VS 2013 (_MSC_VER 1800) has inttypes.h */
|
|
69
64
|
# include <stdint.h>
|
|
65
|
+
#else
|
|
66
|
+
# include <inttypes.h>
|
|
70
67
|
#endif
|
|
71
68
|
|
|
72
69
|
#if defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
|
|
@@ -27,9 +27,6 @@
|
|
|
27
27
|
|
|
28
28
|
#include "hb.h"
|
|
29
29
|
|
|
30
|
-
HB_BEGIN_DECLS
|
|
31
|
-
HB_END_DECLS
|
|
32
|
-
|
|
33
30
|
#ifdef __cplusplus
|
|
34
31
|
|
|
35
32
|
#include <functional>
|
|
@@ -56,15 +53,15 @@ struct shared_ptr
|
|
|
56
53
|
|
|
57
54
|
explicit shared_ptr (T *p = nullptr) : p (p) {}
|
|
58
55
|
shared_ptr (const shared_ptr &o) : p (v::reference (o.p)) {}
|
|
59
|
-
shared_ptr (shared_ptr &&o) : p (o.p) { o.p = nullptr; }
|
|
56
|
+
shared_ptr (shared_ptr &&o) noexcept : p (o.p) { o.p = nullptr; }
|
|
60
57
|
shared_ptr& operator = (const shared_ptr &o) { if (p != o.p) { destroy (); p = o.p; reference (); } return *this; }
|
|
61
|
-
shared_ptr& operator = (shared_ptr &&o) { v::destroy (p); p = o.p; o.p = nullptr; return *this; }
|
|
58
|
+
shared_ptr& operator = (shared_ptr &&o) noexcept { v::destroy (p); p = o.p; o.p = nullptr; return *this; }
|
|
62
59
|
~shared_ptr () { v::destroy (p); p = nullptr; }
|
|
63
60
|
|
|
64
61
|
T* get() const { return p; }
|
|
65
62
|
|
|
66
|
-
void swap (shared_ptr &o) { std::swap (p, o.p); }
|
|
67
|
-
friend void swap (shared_ptr &a, shared_ptr &b) { std::swap (a.p, b.p); }
|
|
63
|
+
void swap (shared_ptr &o) noexcept { std::swap (p, o.p); }
|
|
64
|
+
friend void swap (shared_ptr &a, shared_ptr &b) noexcept { std::swap (a.p, b.p); }
|
|
68
65
|
|
|
69
66
|
operator T * () const { return p; }
|
|
70
67
|
T& operator * () const { return *get (); }
|
|
@@ -98,16 +95,16 @@ struct unique_ptr
|
|
|
98
95
|
|
|
99
96
|
explicit unique_ptr (T *p = nullptr) : p (p) {}
|
|
100
97
|
unique_ptr (const unique_ptr &o) = delete;
|
|
101
|
-
unique_ptr (unique_ptr &&o) : p (o.p) { o.p = nullptr; }
|
|
98
|
+
unique_ptr (unique_ptr &&o) noexcept : p (o.p) { o.p = nullptr; }
|
|
102
99
|
unique_ptr& operator = (const unique_ptr &o) = delete;
|
|
103
|
-
unique_ptr& operator = (unique_ptr &&o) { v::destroy (p); p = o.p; o.p = nullptr; return *this; }
|
|
100
|
+
unique_ptr& operator = (unique_ptr &&o) noexcept { v::destroy (p); p = o.p; o.p = nullptr; return *this; }
|
|
104
101
|
~unique_ptr () { v::destroy (p); p = nullptr; }
|
|
105
102
|
|
|
106
103
|
T* get() const { return p; }
|
|
107
104
|
T* release () { T* v = p; p = nullptr; return v; }
|
|
108
105
|
|
|
109
|
-
void swap (unique_ptr &o) { std::swap (p, o.p); }
|
|
110
|
-
friend void swap (unique_ptr &a, unique_ptr &b) { std::swap (a.p, b.p); }
|
|
106
|
+
void swap (unique_ptr &o) noexcept { std::swap (p, o.p); }
|
|
107
|
+
friend void swap (unique_ptr &a, unique_ptr &b) noexcept { std::swap (a.p, b.p); }
|
|
111
108
|
|
|
112
109
|
operator T * () const { return p; }
|
|
113
110
|
T& operator * () const { return *get (); }
|
|
@@ -73,6 +73,8 @@ typedef struct hb_subset_plan_t hb_subset_plan_t;
|
|
|
73
73
|
* OS/2 will not be recalculated.
|
|
74
74
|
* @HB_SUBSET_FLAGS_NO_LAYOUT_CLOSURE: If set don't perform glyph closure on layout
|
|
75
75
|
* substitution rules (GSUB). Since: 7.2.0.
|
|
76
|
+
* @HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS: If set perform IUP delta optimization on the
|
|
77
|
+
* remaining gvar table's deltas. Since: 8.5.0
|
|
76
78
|
* @HB_SUBSET_FLAGS_IFTB_REQUIREMENTS: If set enforce requirements on the output subset
|
|
77
79
|
* to allow it to be used with incremental font transfer IFTB patches. Primarily,
|
|
78
80
|
* this forces all outline data to use long (32 bit) offsets. Since: EXPERIMENTAL
|
|
@@ -93,8 +95,9 @@ typedef enum { /*< flags >*/
|
|
|
93
95
|
HB_SUBSET_FLAGS_GLYPH_NAMES = 0x00000080u,
|
|
94
96
|
HB_SUBSET_FLAGS_NO_PRUNE_UNICODE_RANGES = 0x00000100u,
|
|
95
97
|
HB_SUBSET_FLAGS_NO_LAYOUT_CLOSURE = 0x00000200u,
|
|
98
|
+
HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS = 0x00000400u,
|
|
96
99
|
#ifdef HB_EXPERIMENTAL_API
|
|
97
|
-
HB_SUBSET_FLAGS_IFTB_REQUIREMENTS =
|
|
100
|
+
HB_SUBSET_FLAGS_IFTB_REQUIREMENTS = 0x00000800u,
|
|
98
101
|
#endif
|
|
99
102
|
} hb_subset_flags_t;
|
|
100
103
|
|
|
@@ -170,6 +173,10 @@ HB_EXTERN void
|
|
|
170
173
|
hb_subset_input_set_flags (hb_subset_input_t *input,
|
|
171
174
|
unsigned value);
|
|
172
175
|
|
|
176
|
+
HB_EXTERN hb_bool_t
|
|
177
|
+
hb_subset_input_pin_all_axes_to_default (hb_subset_input_t *input,
|
|
178
|
+
hb_face_t *face);
|
|
179
|
+
|
|
173
180
|
HB_EXTERN hb_bool_t
|
|
174
181
|
hb_subset_input_pin_axis_to_default (hb_subset_input_t *input,
|
|
175
182
|
hb_face_t *face,
|
|
@@ -181,15 +188,22 @@ hb_subset_input_pin_axis_location (hb_subset_input_t *input,
|
|
|
181
188
|
hb_tag_t axis_tag,
|
|
182
189
|
float axis_value);
|
|
183
190
|
|
|
184
|
-
|
|
191
|
+
HB_EXTERN hb_bool_t
|
|
192
|
+
hb_subset_input_get_axis_range (hb_subset_input_t *input,
|
|
193
|
+
hb_tag_t axis_tag,
|
|
194
|
+
float *axis_min_value,
|
|
195
|
+
float *axis_max_value,
|
|
196
|
+
float *axis_def_value);
|
|
197
|
+
|
|
185
198
|
HB_EXTERN hb_bool_t
|
|
186
199
|
hb_subset_input_set_axis_range (hb_subset_input_t *input,
|
|
187
200
|
hb_face_t *face,
|
|
188
201
|
hb_tag_t axis_tag,
|
|
189
202
|
float axis_min_value,
|
|
190
203
|
float axis_max_value,
|
|
191
|
-
float
|
|
204
|
+
float axis_def_value);
|
|
192
205
|
|
|
206
|
+
#ifdef HB_EXPERIMENTAL_API
|
|
193
207
|
HB_EXTERN hb_bool_t
|
|
194
208
|
hb_subset_input_override_name_table (hb_subset_input_t *input,
|
|
195
209
|
hb_ot_name_id_t name_id,
|
|
@@ -198,7 +212,6 @@ hb_subset_input_override_name_table (hb_subset_input_t *input,
|
|
|
198
212
|
unsigned language_id,
|
|
199
213
|
const char *name_str,
|
|
200
214
|
int str_len);
|
|
201
|
-
|
|
202
215
|
#endif
|
|
203
216
|
|
|
204
217
|
HB_EXTERN hb_face_t *
|
|
@@ -41,13 +41,13 @@ HB_BEGIN_DECLS
|
|
|
41
41
|
*
|
|
42
42
|
* The major component of the library version available at compile-time.
|
|
43
43
|
*/
|
|
44
|
-
#define HB_VERSION_MAJOR
|
|
44
|
+
#define HB_VERSION_MAJOR 9
|
|
45
45
|
/**
|
|
46
46
|
* HB_VERSION_MINOR:
|
|
47
47
|
*
|
|
48
48
|
* The minor component of the library version available at compile-time.
|
|
49
49
|
*/
|
|
50
|
-
#define HB_VERSION_MINOR
|
|
50
|
+
#define HB_VERSION_MINOR 0
|
|
51
51
|
/**
|
|
52
52
|
* HB_VERSION_MICRO:
|
|
53
53
|
*
|
|
@@ -60,7 +60,7 @@ HB_BEGIN_DECLS
|
|
|
60
60
|
*
|
|
61
61
|
* A string literal containing the library version available at compile-time.
|
|
62
62
|
*/
|
|
63
|
-
#define HB_VERSION_STRING "
|
|
63
|
+
#define HB_VERSION_STRING "9.0.0"
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* HB_VERSION_ATLEAST:
|
|
@@ -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_
|
|
@@ -18,17 +18,32 @@
|
|
|
18
18
|
|
|
19
19
|
// Memory allocator with support for alignment and offsets.
|
|
20
20
|
|
|
21
|
+
#include <algorithm>
|
|
22
|
+
#include <array>
|
|
23
|
+
#include <cassert>
|
|
24
|
+
#include <cstdint>
|
|
25
|
+
#include <cstring>
|
|
26
|
+
#include <initializer_list>
|
|
21
27
|
#include <memory>
|
|
28
|
+
#include <type_traits>
|
|
22
29
|
#include <utility>
|
|
30
|
+
#include <vector>
|
|
23
31
|
|
|
24
32
|
#include "hwy/base.h"
|
|
33
|
+
#include "hwy/per_target.h"
|
|
25
34
|
|
|
26
35
|
namespace hwy {
|
|
27
36
|
|
|
28
37
|
// Minimum alignment of allocated memory for use in HWY_ASSUME_ALIGNED, which
|
|
29
|
-
// requires a literal.
|
|
30
|
-
//
|
|
31
|
-
|
|
38
|
+
// requires a literal. To prevent false sharing, this should be at least the
|
|
39
|
+
// L1 cache line size, usually 64 bytes. However, Intel's L2 prefetchers may
|
|
40
|
+
// access pairs of lines, and M1 L2 and POWER8 lines are also 128 bytes.
|
|
41
|
+
#define HWY_ALIGNMENT 128
|
|
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
|
+
}
|
|
32
47
|
|
|
33
48
|
// Pointers to functions equivalent to malloc/free with an opaque void* passed
|
|
34
49
|
// to them.
|
|
@@ -40,7 +55,8 @@ using FreePtr = void (*)(void* opaque, void* memory);
|
|
|
40
55
|
// the vector size. Calls `alloc` with the passed `opaque` pointer to obtain
|
|
41
56
|
// memory or malloc() if it is null.
|
|
42
57
|
HWY_DLLEXPORT void* AllocateAlignedBytes(size_t payload_size,
|
|
43
|
-
AllocPtr alloc_ptr
|
|
58
|
+
AllocPtr alloc_ptr = nullptr,
|
|
59
|
+
void* opaque_ptr = nullptr);
|
|
44
60
|
|
|
45
61
|
// Frees all memory. No effect if `aligned_pointer` == nullptr, otherwise it
|
|
46
62
|
// must have been returned from a previous call to `AllocateAlignedBytes`.
|
|
@@ -110,12 +126,51 @@ AlignedUniquePtr<T> MakeUniqueAlignedWithAlloc(AllocPtr alloc, FreePtr free,
|
|
|
110
126
|
// functions.
|
|
111
127
|
template <typename T, typename... Args>
|
|
112
128
|
AlignedUniquePtr<T> MakeUniqueAligned(Args&&... args) {
|
|
113
|
-
T* ptr = static_cast<T*>(AllocateAlignedBytes(
|
|
114
|
-
sizeof(T), /*alloc_ptr=*/nullptr, /*opaque_ptr=*/nullptr));
|
|
129
|
+
T* ptr = static_cast<T*>(AllocateAlignedBytes(sizeof(T)));
|
|
115
130
|
return AlignedUniquePtr<T>(new (ptr) T(std::forward<Args>(args)...),
|
|
116
131
|
AlignedDeleter());
|
|
117
132
|
}
|
|
118
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
|
+
|
|
119
174
|
// Helpers for array allocators (avoids overflow)
|
|
120
175
|
namespace detail {
|
|
121
176
|
|
|
@@ -207,5 +262,162 @@ AlignedFreeUniquePtr<T[]> AllocateAligned(const size_t items) {
|
|
|
207
262
|
return AllocateAligned<T>(items, nullptr, nullptr, nullptr);
|
|
208
263
|
}
|
|
209
264
|
|
|
265
|
+
// A simple span containing data and size of data.
|
|
266
|
+
template <typename T>
|
|
267
|
+
class Span {
|
|
268
|
+
public:
|
|
269
|
+
Span() = default;
|
|
270
|
+
Span(T* data, size_t size) : size_(size), data_(data) {}
|
|
271
|
+
template <typename U>
|
|
272
|
+
Span(U u) : Span(u.data(), u.size()) {}
|
|
273
|
+
Span(std::initializer_list<const T> v) : Span(v.begin(), v.size()) {}
|
|
274
|
+
|
|
275
|
+
// Copies the contents of the initializer list to the span.
|
|
276
|
+
Span<T>& operator=(std::initializer_list<const T> v) {
|
|
277
|
+
HWY_DASSERT(size_ == v.size());
|
|
278
|
+
CopyBytes(v.begin(), data_, sizeof(T) * std::min(size_, v.size()));
|
|
279
|
+
return *this;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Returns the size of the contained data.
|
|
283
|
+
size_t size() const { return size_; }
|
|
284
|
+
|
|
285
|
+
// Returns a pointer to the contained data.
|
|
286
|
+
T* data() { return data_; }
|
|
287
|
+
T* data() const { return data_; }
|
|
288
|
+
|
|
289
|
+
// Returns the element at index.
|
|
290
|
+
T& operator[](size_t index) const { return data_[index]; }
|
|
291
|
+
|
|
292
|
+
// Returns an iterator pointing to the first element of this span.
|
|
293
|
+
T* begin() { return data_; }
|
|
294
|
+
|
|
295
|
+
// Returns a const iterator pointing to the first element of this span.
|
|
296
|
+
constexpr const T* cbegin() const { return data_; }
|
|
297
|
+
|
|
298
|
+
// Returns an iterator pointing just beyond the last element at the
|
|
299
|
+
// end of this span.
|
|
300
|
+
T* end() { return data_ + size_; }
|
|
301
|
+
|
|
302
|
+
// Returns a const iterator pointing just beyond the last element at the
|
|
303
|
+
// end of this span.
|
|
304
|
+
constexpr const T* cend() const { return data_ + size_; }
|
|
305
|
+
|
|
306
|
+
private:
|
|
307
|
+
size_t size_ = 0;
|
|
308
|
+
T* data_ = nullptr;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
// A multi dimensional array containing an aligned buffer.
|
|
312
|
+
//
|
|
313
|
+
// To maintain alignment, the innermost dimension will be padded to ensure all
|
|
314
|
+
// innermost arrays are aligned.
|
|
315
|
+
template <typename T, size_t axes>
|
|
316
|
+
class AlignedNDArray {
|
|
317
|
+
static_assert(std::is_trivial<T>::value,
|
|
318
|
+
"AlignedNDArray can only contain trivial types");
|
|
319
|
+
|
|
320
|
+
public:
|
|
321
|
+
AlignedNDArray(AlignedNDArray&& other) = default;
|
|
322
|
+
AlignedNDArray& operator=(AlignedNDArray&& other) = default;
|
|
323
|
+
|
|
324
|
+
// Constructs an array of the provided shape and fills it with zeros.
|
|
325
|
+
explicit AlignedNDArray(std::array<size_t, axes> shape) : shape_(shape) {
|
|
326
|
+
sizes_ = ComputeSizes(shape_);
|
|
327
|
+
memory_shape_ = shape_;
|
|
328
|
+
// Round the innermost dimension up to the number of bytes available for
|
|
329
|
+
// SIMD operations on this architecture to make sure that each innermost
|
|
330
|
+
// array is aligned from the first element.
|
|
331
|
+
memory_shape_[axes - 1] = RoundUpTo(memory_shape_[axes - 1], VectorBytes());
|
|
332
|
+
memory_sizes_ = ComputeSizes(memory_shape_);
|
|
333
|
+
buffer_ = hwy::AllocateAligned<T>(memory_size());
|
|
334
|
+
hwy::ZeroBytes(buffer_.get(), memory_size() * sizeof(T));
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Returns a span containing the innermost array at the provided indices.
|
|
338
|
+
Span<T> operator[](std::array<const size_t, axes - 1> indices) {
|
|
339
|
+
return Span<T>(buffer_.get() + Offset(indices), sizes_[indices.size()]);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Returns a const span containing the innermost array at the provided
|
|
343
|
+
// indices.
|
|
344
|
+
Span<const T> operator[](std::array<const size_t, axes - 1> indices) const {
|
|
345
|
+
return Span<const T>(buffer_.get() + Offset(indices),
|
|
346
|
+
sizes_[indices.size()]);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Returns the shape of the array, which might be smaller than the allocated
|
|
350
|
+
// buffer after padding the last axis to alignment.
|
|
351
|
+
const std::array<size_t, axes>& shape() const { return shape_; }
|
|
352
|
+
|
|
353
|
+
// Returns the shape of the allocated buffer, which might be larger than the
|
|
354
|
+
// used size of the array after padding to alignment.
|
|
355
|
+
const std::array<size_t, axes>& memory_shape() const { return memory_shape_; }
|
|
356
|
+
|
|
357
|
+
// Returns the size of the array, which might be smaller than the allocated
|
|
358
|
+
// buffer after padding the last axis to alignment.
|
|
359
|
+
size_t size() const { return sizes_[0]; }
|
|
360
|
+
|
|
361
|
+
// Returns the size of the allocated buffer, which might be larger than the
|
|
362
|
+
// used size of the array after padding to alignment.
|
|
363
|
+
size_t memory_size() const { return memory_sizes_[0]; }
|
|
364
|
+
|
|
365
|
+
// Returns a pointer to the allocated buffer.
|
|
366
|
+
T* data() { return buffer_.get(); }
|
|
367
|
+
|
|
368
|
+
// Returns a const pointer to the buffer.
|
|
369
|
+
const T* data() const { return buffer_.get(); }
|
|
370
|
+
|
|
371
|
+
// Truncates the array by updating its shape.
|
|
372
|
+
//
|
|
373
|
+
// The new shape must be equal to or less than the old shape in all axes.
|
|
374
|
+
//
|
|
375
|
+
// Doesn't modify underlying memory.
|
|
376
|
+
void truncate(const std::array<size_t, axes>& new_shape) {
|
|
377
|
+
#if HWY_IS_DEBUG_BUILD
|
|
378
|
+
for (size_t axis_index = 0; axis_index < axes; ++axis_index) {
|
|
379
|
+
HWY_ASSERT(new_shape[axis_index] <= shape_[axis_index]);
|
|
380
|
+
}
|
|
381
|
+
#endif
|
|
382
|
+
shape_ = new_shape;
|
|
383
|
+
sizes_ = ComputeSizes(shape_);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
private:
|
|
387
|
+
std::array<size_t, axes> shape_;
|
|
388
|
+
std::array<size_t, axes> memory_shape_;
|
|
389
|
+
std::array<size_t, axes + 1> sizes_;
|
|
390
|
+
std::array<size_t, axes + 1> memory_sizes_;
|
|
391
|
+
hwy::AlignedFreeUniquePtr<T[]> buffer_;
|
|
392
|
+
|
|
393
|
+
// Computes offset in the buffer based on the provided indices.
|
|
394
|
+
size_t Offset(std::array<const size_t, axes - 1> indices) const {
|
|
395
|
+
size_t offset = 0;
|
|
396
|
+
size_t shape_index = 0;
|
|
397
|
+
for (const size_t axis_index : indices) {
|
|
398
|
+
offset += memory_sizes_[shape_index + 1] * axis_index;
|
|
399
|
+
shape_index++;
|
|
400
|
+
}
|
|
401
|
+
return offset;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// Computes the sizes of all sub arrays based on the sizes of each axis.
|
|
405
|
+
//
|
|
406
|
+
// Does this by multiplying the size of each axis with the previous one in
|
|
407
|
+
// reverse order, starting with the conceptual axis of size 1 containing the
|
|
408
|
+
// actual elements in the array.
|
|
409
|
+
static std::array<size_t, axes + 1> ComputeSizes(
|
|
410
|
+
std::array<size_t, axes> shape) {
|
|
411
|
+
std::array<size_t, axes + 1> sizes;
|
|
412
|
+
size_t axis = shape.size();
|
|
413
|
+
sizes[axis] = 1;
|
|
414
|
+
while (axis > 0) {
|
|
415
|
+
--axis;
|
|
416
|
+
sizes[axis] = sizes[axis + 1] * shape[axis];
|
|
417
|
+
}
|
|
418
|
+
return sizes;
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
|
|
210
422
|
} // namespace hwy
|
|
211
423
|
#endif // HIGHWAY_HWY_ALIGNED_ALLOCATOR_H_
|