@img/sharp-libvips-dev-wasm32 1.0.0 → 1.0.2

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.
Files changed (203) hide show
  1. package/include/aom/aom_encoder.h +3 -3
  2. package/include/aom/aomcx.h +17 -8
  3. package/include/expat.h +21 -10
  4. package/include/expat_config.h +11 -5
  5. package/include/ffi.h +12 -25
  6. package/include/glib-2.0/gio/gappinfo.h +0 -7
  7. package/include/glib-2.0/gio/gapplication.h +6 -0
  8. package/include/glib-2.0/gio/gapplicationcommandline.h +12 -1
  9. package/include/glib-2.0/gio/gasyncinitable.h +0 -7
  10. package/include/glib-2.0/gio/gasyncresult.h +0 -6
  11. package/include/glib-2.0/gio/gbufferedinputstream.h +0 -5
  12. package/include/glib-2.0/gio/gbufferedoutputstream.h +0 -5
  13. package/include/glib-2.0/gio/gbytesicon.h +0 -5
  14. package/include/glib-2.0/gio/gcancellable.h +0 -5
  15. package/include/glib-2.0/gio/gconverter.h +0 -7
  16. package/include/glib-2.0/gio/gconverterinputstream.h +0 -6
  17. package/include/glib-2.0/gio/gconverteroutputstream.h +0 -6
  18. package/include/glib-2.0/gio/gdatagrambased.h +0 -7
  19. package/include/glib-2.0/gio/gdatainputstream.h +0 -6
  20. package/include/glib-2.0/gio/gdataoutputstream.h +0 -6
  21. package/include/glib-2.0/gio/gdbusinterface.h +0 -8
  22. package/include/glib-2.0/gio/gdbusinterfaceskeleton.h +0 -8
  23. package/include/glib-2.0/gio/gdbusmessage.h +2 -1
  24. package/include/glib-2.0/gio/gdbusobjectmanagerclient.h +0 -8
  25. package/include/glib-2.0/gio/gdbusobjectmanagerserver.h +0 -8
  26. package/include/glib-2.0/gio/gdbusobjectproxy.h +0 -8
  27. package/include/glib-2.0/gio/gdbusobjectskeleton.h +0 -8
  28. package/include/glib-2.0/gio/gdbusproxy.h +0 -8
  29. package/include/glib-2.0/gio/gdebugcontroller.h +0 -8
  30. package/include/glib-2.0/gio/gdebugcontrollerdbus.h +0 -7
  31. package/include/glib-2.0/gio/gdtlsserverconnection.h +0 -8
  32. package/include/glib-2.0/gio/gemblem.h +0 -5
  33. package/include/glib-2.0/gio/gemblemedicon.h +0 -5
  34. package/include/glib-2.0/gio/gfile.h +0 -10
  35. package/include/glib-2.0/gio/gfileenumerator.h +0 -5
  36. package/include/glib-2.0/gio/gfileicon.h +0 -5
  37. package/include/glib-2.0/gio/gfileinfo.h +0 -5
  38. package/include/glib-2.0/gio/gfileinputstream.h +0 -8
  39. package/include/glib-2.0/gio/gfileiostream.h +0 -8
  40. package/include/glib-2.0/gio/gfilemonitor.h +0 -5
  41. package/include/glib-2.0/gio/gfilenamecompleter.h +0 -5
  42. package/include/glib-2.0/gio/gfileoutputstream.h +0 -8
  43. package/include/glib-2.0/gio/gfilterinputstream.h +0 -5
  44. package/include/glib-2.0/gio/gfilteroutputstream.h +0 -5
  45. package/include/glib-2.0/gio/gicon.h +0 -5
  46. package/include/glib-2.0/gio/ginitable.h +0 -7
  47. package/include/glib-2.0/gio/ginputstream.h +0 -5
  48. package/include/glib-2.0/gio/gio-autocleanups.h +4 -0
  49. package/include/glib-2.0/gio/gio-visibility.h +34 -0
  50. package/include/glib-2.0/gio/gioenums.h +6 -1
  51. package/include/glib-2.0/gio/giomodule.h +0 -5
  52. package/include/glib-2.0/gio/giostream.h +0 -5
  53. package/include/glib-2.0/gio/giotypes.h +5 -108
  54. package/include/glib-2.0/gio/gloadableicon.h +0 -6
  55. package/include/glib-2.0/gio/gmemoryinputstream.h +0 -5
  56. package/include/glib-2.0/gio/gmemoryoutputstream.h +0 -5
  57. package/include/glib-2.0/gio/gmountoperation.h +0 -6
  58. package/include/glib-2.0/gio/gnetworking.h +4 -0
  59. package/include/glib-2.0/gio/goutputstream.h +0 -9
  60. package/include/glib-2.0/gio/gpollableinputstream.h +0 -7
  61. package/include/glib-2.0/gio/gpollableoutputstream.h +0 -7
  62. package/include/glib-2.0/gio/gproxy.h +0 -7
  63. package/include/glib-2.0/gio/gproxyaddressenumerator.h +0 -8
  64. package/include/glib-2.0/gio/gseekable.h +0 -5
  65. package/include/glib-2.0/gio/gsettingsbackend.h +0 -5
  66. package/include/glib-2.0/gio/gsimpleactiongroup.h +0 -7
  67. package/include/glib-2.0/gio/gsimpleasyncresult.h +0 -5
  68. package/include/glib-2.0/gio/gsimpleproxyresolver.h +0 -5
  69. package/include/glib-2.0/gio/gsocket.h +13 -0
  70. package/include/glib-2.0/gio/gsocketaddressenumerator.h +0 -6
  71. package/include/glib-2.0/gio/gsocketconnectable.h +0 -5
  72. package/include/glib-2.0/gio/gtask.h +12 -0
  73. package/include/glib-2.0/gio/gthemedicon.h +0 -5
  74. package/include/glib-2.0/gio/gtlsserverconnection.h +0 -8
  75. package/include/glib-2.0/gio/gunixcredentialsmessage.h +0 -8
  76. package/include/glib-2.0/gio/gvfs.h +0 -5
  77. package/include/glib-2.0/gio/gvolume.h +2 -2
  78. package/include/glib-2.0/gio/gvolumemonitor.h +0 -5
  79. package/include/glib-2.0/glib/deprecated/gcompletion.h +1 -1
  80. package/include/glib-2.0/glib/deprecated/grel.h +0 -23
  81. package/include/glib-2.0/glib/deprecated/gthread.h +10 -6
  82. package/include/glib-2.0/glib/gatomic.h +20 -20
  83. package/include/glib-2.0/glib/gbitlock.h +31 -0
  84. package/include/glib-2.0/glib/gbookmarkfile.h +39 -1
  85. package/include/glib-2.0/glib/gchecksum.h +0 -10
  86. package/include/glib-2.0/glib/gdate.h +0 -9
  87. package/include/glib-2.0/glib/gdatetime.h +33 -1
  88. package/include/glib-2.0/glib/gdir.h +5 -0
  89. package/include/glib-2.0/glib/ghmac.h +0 -9
  90. package/include/glib-2.0/glib/glib-autocleanups.h +4 -0
  91. package/include/glib-2.0/glib/glib-visibility.h +34 -0
  92. package/include/glib-2.0/glib/gmacros.h +1 -0
  93. package/include/glib-2.0/glib/gmessages.h +11 -0
  94. package/include/glib-2.0/glib/gpathbuf.h +0 -7
  95. package/include/glib-2.0/glib/gslice.h +2 -0
  96. package/include/glib-2.0/glib/gstdio.h +1 -1
  97. package/include/glib-2.0/glib/gstrfuncs.h +24 -18
  98. package/include/glib-2.0/glib/gstrvbuilder.h +4 -8
  99. package/include/glib-2.0/glib/gtestutils.h +5 -0
  100. package/include/glib-2.0/glib/gthread.h +216 -3
  101. package/include/glib-2.0/glib/gunicode.h +12 -2
  102. package/include/glib-2.0/glib/gvarianttype.h +1 -10
  103. package/include/glib-2.0/glib/gversionmacros.h +9 -0
  104. package/include/glib-2.0/glib/gwin32.h +4 -4
  105. package/include/glib-2.0/glib-unix.h +214 -0
  106. package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
  107. package/include/glib-2.0/gobject/gbinding.h +0 -8
  108. package/include/glib-2.0/gobject/gbindinggroup.h +0 -8
  109. package/include/glib-2.0/gobject/gclosure.h +1 -9
  110. package/include/glib-2.0/gobject/genums.h +6 -6
  111. package/include/glib-2.0/gobject/glib-types.h +44 -0
  112. package/include/glib-2.0/gobject/gobject-autocleanups.h +4 -0
  113. package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
  114. package/include/glib-2.0/gobject/gobject.h +1 -16
  115. package/include/glib-2.0/gobject/gparam.h +3 -12
  116. package/include/glib-2.0/gobject/gsignal.h +16 -6
  117. package/include/glib-2.0/gobject/gsignalgroup.h +0 -8
  118. package/include/glib-2.0/gobject/gtype.h +53 -20
  119. package/include/glib-2.0/gobject/gtypemodule.h +0 -7
  120. package/include/glib-2.0/gobject/gtypeplugin.h +0 -6
  121. package/include/glib-2.0/gobject/gvaluearray.h +0 -7
  122. package/include/glib-2.0/gobject/gvaluecollector.h +1 -11
  123. package/include/glib-2.0/gobject/gvaluetypes.h +2 -0
  124. package/include/hwy/aligned_allocator.h +171 -6
  125. package/include/hwy/base.h +1765 -543
  126. package/include/hwy/cache_control.h +24 -6
  127. package/include/hwy/detect_compiler_arch.h +23 -2
  128. package/include/hwy/detect_targets.h +56 -13
  129. package/include/hwy/foreach_target.h +24 -0
  130. package/include/hwy/highway.h +20 -3
  131. package/include/hwy/ops/arm_neon-inl.h +1086 -667
  132. package/include/hwy/ops/arm_sve-inl.h +1091 -235
  133. package/include/hwy/ops/emu128-inl.h +271 -196
  134. package/include/hwy/ops/generic_ops-inl.h +2270 -399
  135. package/include/hwy/ops/ppc_vsx-inl.h +1786 -563
  136. package/include/hwy/ops/rvv-inl.h +1043 -311
  137. package/include/hwy/ops/scalar-inl.h +189 -159
  138. package/include/hwy/ops/set_macros-inl.h +66 -6
  139. package/include/hwy/ops/shared-inl.h +175 -56
  140. package/include/hwy/ops/wasm_128-inl.h +153 -136
  141. package/include/hwy/ops/x86_128-inl.h +1647 -646
  142. package/include/hwy/ops/x86_256-inl.h +1003 -370
  143. package/include/hwy/ops/x86_512-inl.h +948 -353
  144. package/include/hwy/per_target.h +4 -0
  145. package/include/hwy/profiler.h +648 -0
  146. package/include/hwy/robust_statistics.h +2 -2
  147. package/include/hwy/targets.h +18 -11
  148. package/include/hwy/timer.h +11 -0
  149. package/include/lcms2.h +46 -7
  150. package/include/lcms2_plugin.h +4 -4
  151. package/include/libheif/heif_version.h +2 -2
  152. package/include/resvg.h +15 -3
  153. package/include/vips/connection.h +9 -3
  154. package/include/vips/util.h +0 -9
  155. package/include/vips/version.h +4 -4
  156. package/include/zconf.h +3 -0
  157. package/include/zlib.h +3 -3
  158. package/lib/glib-2.0/include/glibconfig.h +3 -2
  159. package/lib/libaom.a +0 -0
  160. package/lib/libcgif.a +0 -0
  161. package/lib/libexif.a +0 -0
  162. package/lib/libexpat.a +0 -0
  163. package/lib/libexpat.la +3 -3
  164. package/lib/libffi.a +0 -0
  165. package/lib/libffi.la +2 -2
  166. package/lib/libgio-2.0.a +0 -0
  167. package/lib/libglib-2.0.a +0 -0
  168. package/lib/libgmodule-2.0.a +0 -0
  169. package/lib/libgobject-2.0.a +0 -0
  170. package/lib/libgthread-2.0.a +0 -0
  171. package/lib/libheif.a +0 -0
  172. package/lib/libhwy.a +0 -0
  173. package/lib/libimagequant.a +0 -0
  174. package/lib/libjpeg.a +0 -0
  175. package/lib/liblcms2.a +0 -0
  176. package/lib/libresvg.a +0 -0
  177. package/lib/libsharpyuv.a +0 -0
  178. package/lib/libspng.a +0 -0
  179. package/lib/libtiff.a +0 -0
  180. package/lib/libvips-cpp.a +0 -0
  181. package/lib/libvips.a +0 -0
  182. package/lib/libwebp.a +0 -0
  183. package/lib/libwebpdemux.a +0 -0
  184. package/lib/libwebpmux.a +0 -0
  185. package/lib/libz.a +0 -0
  186. package/lib/pkgconfig/aom.pc +2 -2
  187. package/lib/pkgconfig/expat.pc +2 -1
  188. package/lib/pkgconfig/gio-2.0.pc +3 -3
  189. package/lib/pkgconfig/glib-2.0.pc +3 -3
  190. package/lib/pkgconfig/gmodule-2.0.pc +1 -1
  191. package/lib/pkgconfig/gmodule-export-2.0.pc +1 -1
  192. package/lib/pkgconfig/gmodule-no-export-2.0.pc +1 -1
  193. package/lib/pkgconfig/gobject-2.0.pc +1 -1
  194. package/lib/pkgconfig/gthread-2.0.pc +1 -1
  195. package/lib/pkgconfig/lcms2.pc +1 -1
  196. package/lib/pkgconfig/libffi.pc +1 -1
  197. package/lib/pkgconfig/libheif.pc +1 -1
  198. package/lib/pkgconfig/libhwy.pc +1 -1
  199. package/lib/pkgconfig/vips-cpp.pc +1 -1
  200. package/lib/pkgconfig/vips.pc +1 -1
  201. package/lib/pkgconfig/zlib.pc +1 -1
  202. package/package.json +1 -1
  203. package/versions.json +11 -10
@@ -421,9 +421,11 @@ G_BEGIN_DECLS
421
421
  * A numerical value which represents the unique identifier of a registered
422
422
  * type.
423
423
  */
424
- #if GLIB_SIZEOF_SIZE_T != GLIB_SIZEOF_LONG || !defined (G_CXX_STD_VERSION)
424
+ #if GLIB_SIZEOF_VOID_P > GLIB_SIZEOF_SIZE_T
425
+ typedef guintptr GType;
426
+ #elif GLIB_SIZEOF_SIZE_T != GLIB_SIZEOF_LONG || !defined (G_CXX_STD_VERSION)
425
427
  typedef gsize GType;
426
- #else /* for historic reasons, C++ links against gulong GTypes */
428
+ #else /* for historic reasons, C++ on non-Morello/CHERI systems links against gulong GTypes */
427
429
  typedef gulong GType;
428
430
  #endif
429
431
  typedef struct _GValue GValue;
@@ -2009,8 +2011,8 @@ guint g_type_get_type_registration_serial (void);
2009
2011
  * GType
2010
2012
  * gtk_gadget_get_type (void)
2011
2013
  * {
2012
- * static gsize static_g_define_type_id = 0;
2013
- * if (g_once_init_enter (&static_g_define_type_id))
2014
+ * static GType static_g_define_type_id = 0;
2015
+ * if (g_once_init_enter_pointer (&static_g_define_type_id))
2014
2016
  * {
2015
2017
  * GType g_define_type_id =
2016
2018
  * g_type_register_static_simple (GTK_TYPE_WIDGET,
@@ -2030,7 +2032,7 @@ guint g_type_get_type_registration_serial (void);
2030
2032
  * };
2031
2033
  * g_type_add_interface_static (g_define_type_id, TYPE_GIZMO, &g_implement_interface_info);
2032
2034
  * }
2033
- * g_once_init_leave (&static_g_define_type_id, g_define_type_id);
2035
+ * g_once_init_leave_pointer (&static_g_define_type_id, g_define_type_id);
2034
2036
  * }
2035
2037
  * return static_g_define_type_id;
2036
2038
  * }
@@ -2267,6 +2269,16 @@ static void type_name##_class_intern_init (gpointer klass, \
2267
2269
  }
2268
2270
  #endif /* GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 */
2269
2271
 
2272
+ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_80
2273
+ #define _g_type_once_init_type GType
2274
+ #define _g_type_once_init_enter g_once_init_enter_pointer
2275
+ #define _g_type_once_init_leave g_once_init_leave_pointer
2276
+ #else /* if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_80 */
2277
+ #define _g_type_once_init_type gsize
2278
+ #define _g_type_once_init_enter g_once_init_enter
2279
+ #define _g_type_once_init_leave g_once_init_leave
2280
+ #endif /* GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_80 */
2281
+
2270
2282
  /* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
2271
2283
  #define _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name, TYPE_PARENT) \
2272
2284
  \
@@ -2293,15 +2305,15 @@ type_name##_get_instance_private (TypeName *self) \
2293
2305
  GType \
2294
2306
  type_name##_get_type (void) \
2295
2307
  { \
2296
- static gsize static_g_define_type_id = 0;
2308
+ static _g_type_once_init_type static_g_define_type_id = 0;
2297
2309
  /* Prelude goes here */
2298
2310
 
2299
2311
  /* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
2300
2312
  #define _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
2301
- if (g_once_init_enter (&static_g_define_type_id)) \
2313
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2302
2314
  { \
2303
2315
  GType g_define_type_id = type_name##_get_type_once (); \
2304
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2316
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2305
2317
  } \
2306
2318
  return static_g_define_type_id; \
2307
2319
  } /* closes type_name##_get_type() */ \
@@ -2346,8 +2358,8 @@ static void type_name##_default_init_adapter (TypeName##Interface *klass, \
2346
2358
  GType \
2347
2359
  type_name##_get_type (void) \
2348
2360
  { \
2349
- static gsize static_g_define_type_id = 0; \
2350
- if (g_once_init_enter (&static_g_define_type_id)) \
2361
+ static _g_type_once_init_type static_g_define_type_id = 0; \
2362
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2351
2363
  { \
2352
2364
  GType g_define_type_id = \
2353
2365
  g_type_register_static_simple (G_TYPE_INTERFACE, \
@@ -2363,7 +2375,7 @@ type_name##_get_type (void) \
2363
2375
  #define _G_DEFINE_INTERFACE_EXTENDED_END() \
2364
2376
  /* following custom code */ \
2365
2377
  } \
2366
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2378
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2367
2379
  } \
2368
2380
  return static_g_define_type_id; \
2369
2381
  } /* closes type_name##_get_type() */
@@ -2472,11 +2484,11 @@ static GType type_name##_get_type_once (void); \
2472
2484
  GType \
2473
2485
  type_name##_get_type (void) \
2474
2486
  { \
2475
- static gsize static_g_define_type_id = 0; \
2476
- if (g_once_init_enter (&static_g_define_type_id)) \
2487
+ static _g_type_once_init_type static_g_define_type_id = 0; \
2488
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2477
2489
  { \
2478
2490
  GType g_define_type_id = type_name##_get_type_once (); \
2479
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2491
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2480
2492
  } \
2481
2493
  return static_g_define_type_id; \
2482
2494
  } \
@@ -2509,11 +2521,11 @@ static GType type_name##_get_type_once (void); \
2509
2521
  GType \
2510
2522
  type_name##_get_type (void) \
2511
2523
  { \
2512
- static gsize static_g_define_type_id = 0; \
2513
- if (g_once_init_enter (&static_g_define_type_id)) \
2524
+ static _g_type_once_init_type static_g_define_type_id = 0; \
2525
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2514
2526
  { \
2515
2527
  GType g_define_type_id = type_name##_get_type_once (); \
2516
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2528
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2517
2529
  } \
2518
2530
  return static_g_define_type_id; \
2519
2531
  } \
@@ -2562,11 +2574,11 @@ static GType type_name##_get_type_once (void); \
2562
2574
  GType \
2563
2575
  type_name##_get_type (void) \
2564
2576
  { \
2565
- static gsize static_g_define_type_id = 0; \
2566
- if (g_once_init_enter (&static_g_define_type_id)) \
2577
+ static _g_type_once_init_type static_g_define_type_id = 0; \
2578
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2567
2579
  { \
2568
2580
  GType g_define_type_id = type_name##_get_type_once (); \
2569
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2581
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2570
2582
  } \
2571
2583
  return static_g_define_type_id; \
2572
2584
  } \
@@ -2710,6 +2722,27 @@ const gchar * g_type_name_from_class (GTypeClass *g_class);
2710
2722
  */
2711
2723
  #define G_TYPE_FLAG_RESERVED_ID_BIT ((GType) (1 << 0))
2712
2724
 
2725
+ /**
2726
+ * GPOINTER_TO_TYPE:
2727
+ * @p: The pointer to convert to a #GType
2728
+ *
2729
+ * This macro should be used instead of GPOINTER_TO_SIZE() to ensure
2730
+ * portability since #GType is not guaranteed to be the same as #gsize.
2731
+ *
2732
+ * Since: 2.80
2733
+ */
2734
+ #define GPOINTER_TO_TYPE(p) ((GType) (guintptr) (p)) GOBJECT_AVAILABLE_MACRO_IN_2_80
2735
+ /**
2736
+ * GTYPE_TO_POINTER:
2737
+ * @t: The #GType to convert to a pointer
2738
+ *
2739
+ * This macro should be used instead of GSIZE_TO_POINTER() to ensure
2740
+ * portability since #GType is not guaranteed to be the same as #gsize.
2741
+ *
2742
+ * Since: 2.80
2743
+ */
2744
+ #define GTYPE_TO_POINTER(t) ((gpointer) (guintptr) (t)) GOBJECT_AVAILABLE_MACRO_IN_2_80
2745
+
2713
2746
  G_END_DECLS
2714
2747
 
2715
2748
  #endif /* __G_TYPE_H__ */
@@ -40,13 +40,6 @@ typedef struct _GTypeModuleClass GTypeModuleClass;
40
40
 
41
41
  G_DEFINE_AUTOPTR_CLEANUP_FUNC(GTypeModule, g_object_unref)
42
42
 
43
- /**
44
- * GTypeModule:
45
- * @name: the name of the module
46
- *
47
- * The members of the GTypeModule structure should not
48
- * be accessed directly, except for the @name field.
49
- */
50
43
  struct _GTypeModule
51
44
  {
52
45
  GObject parent_instance;
@@ -80,12 +80,6 @@ typedef void (*GTypePluginCompleteInterfaceInfo) (GTypePlugin *plugin,
80
80
  GType instance_type,
81
81
  GType interface_type,
82
82
  GInterfaceInfo *info);
83
- /**
84
- * GTypePlugin:
85
- *
86
- * The GTypePlugin typedef is used as a placeholder
87
- * for objects that implement the GTypePlugin interface.
88
- */
89
83
  /**
90
84
  * GTypePluginClass:
91
85
  * @use_plugin: Increases the use count of the plugin.
@@ -41,13 +41,6 @@ G_BEGIN_DECLS
41
41
 
42
42
  /* --- typedefs & structs --- */
43
43
  typedef struct _GValueArray GValueArray;
44
- /**
45
- * GValueArray:
46
- * @n_values: number of values contained in the array
47
- * @values: array of values
48
- *
49
- * A #GValueArray contains an array of #GValue elements.
50
- */
51
44
  struct _GValueArray
52
45
  {
53
46
  guint n_values;
@@ -18,17 +18,7 @@
18
18
  *
19
19
  * gvaluecollector.h: GValue varargs stubs
20
20
  */
21
- /**
22
- * SECTION:value_collection
23
- * @Short_description: Converting varargs to generic values
24
- * @Title: Varargs Value Collection
25
- *
26
- * The macros in this section provide the varargs parsing support needed
27
- * in variadic GObject functions such as g_object_new() or g_object_set().
28
- *
29
- * They currently support the collection of integral types, floating point
30
- * types and pointers.
31
- */
21
+
32
22
  #ifndef __G_VALUE_COLLECTOR_H__
33
23
  #define __G_VALUE_COLLECTOR_H__
34
24
 
@@ -263,6 +263,8 @@ GOBJECT_AVAILABLE_IN_ALL
263
263
  const gchar * g_value_get_string (const GValue *value);
264
264
  GOBJECT_AVAILABLE_IN_ALL
265
265
  gchar* g_value_dup_string (const GValue *value);
266
+ GOBJECT_AVAILABLE_IN_2_80
267
+ gchar* g_value_steal_string (GValue *value);
266
268
  GOBJECT_AVAILABLE_IN_ALL
267
269
  void g_value_set_pointer (GValue *value,
268
270
  gpointer v_pointer);
@@ -18,17 +18,25 @@
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 <cstring>
25
+ #include <initializer_list>
21
26
  #include <memory>
27
+ #include <type_traits>
22
28
  #include <utility>
23
29
 
24
30
  #include "hwy/base.h"
31
+ #include "hwy/per_target.h"
25
32
 
26
33
  namespace hwy {
27
34
 
28
35
  // Minimum alignment of allocated memory for use in HWY_ASSUME_ALIGNED, which
29
- // requires a literal. This matches typical L1 cache line sizes, which prevents
30
- // false sharing.
31
- #define HWY_ALIGNMENT 64
36
+ // requires a literal. To prevent false sharing, this should be at least the
37
+ // L1 cache line size, usually 64 bytes. However, Intel's L2 prefetchers may
38
+ // access pairs of lines, and POWER8 also has 128.
39
+ #define HWY_ALIGNMENT 128
32
40
 
33
41
  // Pointers to functions equivalent to malloc/free with an opaque void* passed
34
42
  // to them.
@@ -40,7 +48,8 @@ using FreePtr = void (*)(void* opaque, void* memory);
40
48
  // the vector size. Calls `alloc` with the passed `opaque` pointer to obtain
41
49
  // memory or malloc() if it is null.
42
50
  HWY_DLLEXPORT void* AllocateAlignedBytes(size_t payload_size,
43
- AllocPtr alloc_ptr, void* opaque_ptr);
51
+ AllocPtr alloc_ptr = nullptr,
52
+ void* opaque_ptr = nullptr);
44
53
 
45
54
  // Frees all memory. No effect if `aligned_pointer` == nullptr, otherwise it
46
55
  // must have been returned from a previous call to `AllocateAlignedBytes`.
@@ -110,8 +119,7 @@ AlignedUniquePtr<T> MakeUniqueAlignedWithAlloc(AllocPtr alloc, FreePtr free,
110
119
  // functions.
111
120
  template <typename T, typename... Args>
112
121
  AlignedUniquePtr<T> MakeUniqueAligned(Args&&... args) {
113
- T* ptr = static_cast<T*>(AllocateAlignedBytes(
114
- sizeof(T), /*alloc_ptr=*/nullptr, /*opaque_ptr=*/nullptr));
122
+ T* ptr = static_cast<T*>(AllocateAlignedBytes(sizeof(T)));
115
123
  return AlignedUniquePtr<T>(new (ptr) T(std::forward<Args>(args)...),
116
124
  AlignedDeleter());
117
125
  }
@@ -207,5 +215,162 @@ AlignedFreeUniquePtr<T[]> AllocateAligned(const size_t items) {
207
215
  return AllocateAligned<T>(items, nullptr, nullptr, nullptr);
208
216
  }
209
217
 
218
+ // A simple span containing data and size of data.
219
+ template <typename T>
220
+ class Span {
221
+ public:
222
+ Span() = default;
223
+ Span(T* data, size_t size) : size_(size), data_(data) {}
224
+ template <typename U>
225
+ Span(U u) : Span(u.data(), u.size()) {}
226
+ Span(std::initializer_list<const T> v) : Span(v.begin(), v.size()) {}
227
+
228
+ // Copies the contents of the initializer list to the span.
229
+ Span<T>& operator=(std::initializer_list<const T> v) {
230
+ HWY_DASSERT(size_ == v.size());
231
+ CopyBytes(v.begin(), data_, sizeof(T) * std::min(size_, v.size()));
232
+ return *this;
233
+ }
234
+
235
+ // Returns the size of the contained data.
236
+ size_t size() const { return size_; }
237
+
238
+ // Returns a pointer to the contained data.
239
+ T* data() { return data_; }
240
+ T* data() const { return data_; }
241
+
242
+ // Returns the element at index.
243
+ T& operator[](size_t index) const { return data_[index]; }
244
+
245
+ // Returns an iterator pointing to the first element of this span.
246
+ T* begin() { return data_; }
247
+
248
+ // Returns a const iterator pointing to the first element of this span.
249
+ constexpr const T* cbegin() const { return data_; }
250
+
251
+ // Returns an iterator pointing just beyond the last element at the
252
+ // end of this span.
253
+ T* end() { return data_ + size_; }
254
+
255
+ // Returns a const iterator pointing just beyond the last element at the
256
+ // end of this span.
257
+ constexpr const T* cend() const { return data_ + size_; }
258
+
259
+ private:
260
+ size_t size_ = 0;
261
+ T* data_ = nullptr;
262
+ };
263
+
264
+ // A multi dimensional array containing an aligned buffer.
265
+ //
266
+ // To maintain alignment, the innermost dimension will be padded to ensure all
267
+ // innermost arrays are aligned.
268
+ template <typename T, size_t axes>
269
+ class AlignedNDArray {
270
+ static_assert(std::is_trivial<T>::value,
271
+ "AlignedNDArray can only contain trivial types");
272
+
273
+ public:
274
+ AlignedNDArray(AlignedNDArray&& other) = default;
275
+ AlignedNDArray& operator=(AlignedNDArray&& other) = default;
276
+
277
+ // Constructs an array of the provided shape and fills it with zeros.
278
+ explicit AlignedNDArray(std::array<size_t, axes> shape) : shape_(shape) {
279
+ sizes_ = ComputeSizes(shape_);
280
+ memory_shape_ = shape_;
281
+ // Round the innermost dimension up to the number of bytes available for
282
+ // SIMD operations on this architecture to make sure that each innermost
283
+ // array is aligned from the first element.
284
+ memory_shape_[axes - 1] = RoundUpTo(memory_shape_[axes - 1], VectorBytes());
285
+ memory_sizes_ = ComputeSizes(memory_shape_);
286
+ buffer_ = hwy::AllocateAligned<T>(memory_size());
287
+ hwy::ZeroBytes(buffer_.get(), memory_size() * sizeof(T));
288
+ }
289
+
290
+ // Returns a span containing the innermost array at the provided indices.
291
+ Span<T> operator[](std::array<const size_t, axes - 1> indices) {
292
+ return Span<T>(buffer_.get() + Offset(indices), sizes_[indices.size()]);
293
+ }
294
+
295
+ // Returns a const span containing the innermost array at the provided
296
+ // indices.
297
+ Span<const T> operator[](std::array<const size_t, axes - 1> indices) const {
298
+ return Span<const T>(buffer_.get() + Offset(indices),
299
+ sizes_[indices.size()]);
300
+ }
301
+
302
+ // Returns the shape of the array, which might be smaller than the allocated
303
+ // buffer after padding the last axis to alignment.
304
+ const std::array<size_t, axes>& shape() const { return shape_; }
305
+
306
+ // Returns the shape of the allocated buffer, which might be larger than the
307
+ // used size of the array after padding to alignment.
308
+ const std::array<size_t, axes>& memory_shape() const { return memory_shape_; }
309
+
310
+ // Returns the size of the array, which might be smaller than the allocated
311
+ // buffer after padding the last axis to alignment.
312
+ size_t size() const { return sizes_[0]; }
313
+
314
+ // Returns the size of the allocated buffer, which might be larger than the
315
+ // used size of the array after padding to alignment.
316
+ size_t memory_size() const { return memory_sizes_[0]; }
317
+
318
+ // Returns a pointer to the allocated buffer.
319
+ T* data() { return buffer_.get(); }
320
+
321
+ // Returns a const pointer to the buffer.
322
+ const T* data() const { return buffer_.get(); }
323
+
324
+ // Truncates the array by updating its shape.
325
+ //
326
+ // The new shape must be equal to or less than the old shape in all axes.
327
+ //
328
+ // Doesn't modify underlying memory.
329
+ void truncate(const std::array<size_t, axes>& new_shape) {
330
+ #if HWY_IS_DEBUG_BUILD
331
+ for (size_t axis_index = 0; axis_index < axes; ++axis_index) {
332
+ HWY_ASSERT(new_shape[axis_index] <= shape_[axis_index]);
333
+ }
334
+ #endif
335
+ shape_ = new_shape;
336
+ sizes_ = ComputeSizes(shape_);
337
+ }
338
+
339
+ private:
340
+ std::array<size_t, axes> shape_;
341
+ std::array<size_t, axes> memory_shape_;
342
+ std::array<size_t, axes + 1> sizes_;
343
+ std::array<size_t, axes + 1> memory_sizes_;
344
+ hwy::AlignedFreeUniquePtr<T[]> buffer_;
345
+
346
+ // Computes offset in the buffer based on the provided indices.
347
+ size_t Offset(std::array<const size_t, axes - 1> indices) const {
348
+ size_t offset = 0;
349
+ size_t shape_index = 0;
350
+ for (const size_t axis_index : indices) {
351
+ offset += memory_sizes_[shape_index + 1] * axis_index;
352
+ shape_index++;
353
+ }
354
+ return offset;
355
+ }
356
+
357
+ // Computes the sizes of all sub arrays based on the sizes of each axis.
358
+ //
359
+ // Does this by multiplying the size of each axis with the previous one in
360
+ // reverse order, starting with the conceptual axis of size 1 containing the
361
+ // actual elements in the array.
362
+ static std::array<size_t, axes + 1> ComputeSizes(
363
+ std::array<size_t, axes> shape) {
364
+ std::array<size_t, axes + 1> sizes;
365
+ size_t axis = shape.size();
366
+ sizes[axis] = 1;
367
+ while (axis > 0) {
368
+ --axis;
369
+ sizes[axis] = sizes[axis + 1] * shape[axis];
370
+ }
371
+ return sizes;
372
+ }
373
+ };
374
+
210
375
  } // namespace hwy
211
376
  #endif // HIGHWAY_HWY_ALIGNED_ALLOCATOR_H_