@img/sharp-libvips-dev 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 (230) 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/fontconfig/fontconfig.h +5 -3
  7. package/include/freetype2/freetype/config/ftoption.h +1 -1
  8. package/include/gio-unix-2.0/gio/gfiledescriptorbased.h +3 -7
  9. package/include/gio-unix-2.0/gio/gunixinputstream.h +0 -5
  10. package/include/gio-unix-2.0/gio/gunixoutputstream.h +0 -5
  11. package/include/glib-2.0/gio/gappinfo.h +0 -7
  12. package/include/glib-2.0/gio/gapplication.h +6 -0
  13. package/include/glib-2.0/gio/gapplicationcommandline.h +12 -1
  14. package/include/glib-2.0/gio/gasyncinitable.h +0 -7
  15. package/include/glib-2.0/gio/gasyncresult.h +0 -6
  16. package/include/glib-2.0/gio/gbufferedinputstream.h +0 -5
  17. package/include/glib-2.0/gio/gbufferedoutputstream.h +0 -5
  18. package/include/glib-2.0/gio/gbytesicon.h +0 -5
  19. package/include/glib-2.0/gio/gcancellable.h +0 -5
  20. package/include/glib-2.0/gio/gconverter.h +0 -7
  21. package/include/glib-2.0/gio/gconverterinputstream.h +0 -6
  22. package/include/glib-2.0/gio/gconverteroutputstream.h +0 -6
  23. package/include/glib-2.0/gio/gdatagrambased.h +0 -7
  24. package/include/glib-2.0/gio/gdatainputstream.h +0 -6
  25. package/include/glib-2.0/gio/gdataoutputstream.h +0 -6
  26. package/include/glib-2.0/gio/gdbusinterface.h +0 -8
  27. package/include/glib-2.0/gio/gdbusinterfaceskeleton.h +0 -8
  28. package/include/glib-2.0/gio/gdbusmessage.h +2 -1
  29. package/include/glib-2.0/gio/gdbusobjectmanagerclient.h +0 -8
  30. package/include/glib-2.0/gio/gdbusobjectmanagerserver.h +0 -8
  31. package/include/glib-2.0/gio/gdbusobjectproxy.h +0 -8
  32. package/include/glib-2.0/gio/gdbusobjectskeleton.h +0 -8
  33. package/include/glib-2.0/gio/gdbusproxy.h +0 -8
  34. package/include/glib-2.0/gio/gdebugcontroller.h +0 -8
  35. package/include/glib-2.0/gio/gdebugcontrollerdbus.h +0 -7
  36. package/include/glib-2.0/gio/gdtlsserverconnection.h +0 -8
  37. package/include/glib-2.0/gio/gemblem.h +0 -5
  38. package/include/glib-2.0/gio/gemblemedicon.h +0 -5
  39. package/include/glib-2.0/gio/gfile.h +0 -10
  40. package/include/glib-2.0/gio/gfileenumerator.h +0 -5
  41. package/include/glib-2.0/gio/gfileicon.h +0 -5
  42. package/include/glib-2.0/gio/gfileinfo.h +0 -5
  43. package/include/glib-2.0/gio/gfileinputstream.h +0 -8
  44. package/include/glib-2.0/gio/gfileiostream.h +0 -8
  45. package/include/glib-2.0/gio/gfilemonitor.h +0 -5
  46. package/include/glib-2.0/gio/gfilenamecompleter.h +0 -5
  47. package/include/glib-2.0/gio/gfileoutputstream.h +0 -8
  48. package/include/glib-2.0/gio/gfilterinputstream.h +0 -5
  49. package/include/glib-2.0/gio/gfilteroutputstream.h +0 -5
  50. package/include/glib-2.0/gio/gicon.h +0 -5
  51. package/include/glib-2.0/gio/ginitable.h +0 -7
  52. package/include/glib-2.0/gio/ginputstream.h +0 -5
  53. package/include/glib-2.0/gio/gio-autocleanups.h +4 -0
  54. package/include/glib-2.0/gio/gio-visibility.h +34 -0
  55. package/include/glib-2.0/gio/gioenums.h +6 -1
  56. package/include/glib-2.0/gio/giomodule.h +0 -5
  57. package/include/glib-2.0/gio/giostream.h +0 -5
  58. package/include/glib-2.0/gio/giotypes.h +5 -108
  59. package/include/glib-2.0/gio/gloadableicon.h +0 -6
  60. package/include/glib-2.0/gio/gmemoryinputstream.h +0 -5
  61. package/include/glib-2.0/gio/gmemoryoutputstream.h +0 -5
  62. package/include/glib-2.0/gio/gmountoperation.h +0 -6
  63. package/include/glib-2.0/gio/gnetworking.h +4 -0
  64. package/include/glib-2.0/gio/goutputstream.h +0 -9
  65. package/include/glib-2.0/gio/gpollableinputstream.h +0 -7
  66. package/include/glib-2.0/gio/gpollableoutputstream.h +0 -7
  67. package/include/glib-2.0/gio/gproxy.h +0 -7
  68. package/include/glib-2.0/gio/gproxyaddressenumerator.h +0 -8
  69. package/include/glib-2.0/gio/gseekable.h +0 -5
  70. package/include/glib-2.0/gio/gsettingsbackend.h +0 -5
  71. package/include/glib-2.0/gio/gsimpleactiongroup.h +0 -7
  72. package/include/glib-2.0/gio/gsimpleasyncresult.h +0 -5
  73. package/include/glib-2.0/gio/gsimpleproxyresolver.h +0 -5
  74. package/include/glib-2.0/gio/gsocket.h +13 -0
  75. package/include/glib-2.0/gio/gsocketaddressenumerator.h +0 -6
  76. package/include/glib-2.0/gio/gsocketconnectable.h +0 -5
  77. package/include/glib-2.0/gio/gtask.h +12 -0
  78. package/include/glib-2.0/gio/gthemedicon.h +0 -5
  79. package/include/glib-2.0/gio/gtlsserverconnection.h +0 -8
  80. package/include/glib-2.0/gio/gunixcredentialsmessage.h +0 -8
  81. package/include/glib-2.0/gio/gvfs.h +0 -5
  82. package/include/glib-2.0/gio/gvolume.h +2 -2
  83. package/include/glib-2.0/gio/gvolumemonitor.h +0 -5
  84. package/include/glib-2.0/girepository/gi-visibility.h +986 -0
  85. package/include/glib-2.0/girepository/giarginfo.h +100 -0
  86. package/include/glib-2.0/girepository/gibaseinfo.h +129 -0
  87. package/include/glib-2.0/girepository/gicallableinfo.h +119 -0
  88. package/include/glib-2.0/girepository/gicallbackinfo.h +60 -0
  89. package/include/glib-2.0/girepository/giconstantinfo.h +72 -0
  90. package/include/glib-2.0/girepository/gienuminfo.h +82 -0
  91. package/include/glib-2.0/girepository/gifieldinfo.h +84 -0
  92. package/include/glib-2.0/girepository/giflagsinfo.h +60 -0
  93. package/include/glib-2.0/girepository/gifunctioninfo.h +117 -0
  94. package/include/glib-2.0/girepository/giinterfaceinfo.h +120 -0
  95. package/include/glib-2.0/girepository/giobjectinfo.h +230 -0
  96. package/include/glib-2.0/girepository/gipropertyinfo.h +77 -0
  97. package/include/glib-2.0/girepository/giregisteredtypeinfo.h +75 -0
  98. package/include/glib-2.0/girepository/girepository-autocleanups.h +56 -0
  99. package/include/glib-2.0/girepository/girepository.h +247 -0
  100. package/include/glib-2.0/girepository/girffi.h +129 -0
  101. package/include/glib-2.0/girepository/gisignalinfo.h +72 -0
  102. package/include/glib-2.0/girepository/gistructinfo.h +102 -0
  103. package/include/glib-2.0/girepository/gitypeinfo.h +144 -0
  104. package/include/glib-2.0/girepository/gitypelib.h +61 -0
  105. package/include/glib-2.0/girepository/gitypes.h +421 -0
  106. package/include/glib-2.0/girepository/giunioninfo.h +105 -0
  107. package/include/glib-2.0/girepository/giunresolvedinfo.h +60 -0
  108. package/include/glib-2.0/girepository/givalueinfo.h +65 -0
  109. package/include/glib-2.0/girepository/givfuncinfo.h +88 -0
  110. package/include/glib-2.0/glib/deprecated/gcompletion.h +1 -1
  111. package/include/glib-2.0/glib/deprecated/grel.h +0 -23
  112. package/include/glib-2.0/glib/deprecated/gthread.h +10 -6
  113. package/include/glib-2.0/glib/gatomic.h +20 -20
  114. package/include/glib-2.0/glib/gbitlock.h +31 -0
  115. package/include/glib-2.0/glib/gbookmarkfile.h +39 -1
  116. package/include/glib-2.0/glib/gchecksum.h +0 -10
  117. package/include/glib-2.0/glib/gdate.h +0 -9
  118. package/include/glib-2.0/glib/gdatetime.h +33 -1
  119. package/include/glib-2.0/glib/gdir.h +5 -0
  120. package/include/glib-2.0/glib/ghmac.h +0 -9
  121. package/include/glib-2.0/glib/glib-autocleanups.h +4 -0
  122. package/include/glib-2.0/glib/glib-visibility.h +34 -0
  123. package/include/glib-2.0/glib/gmacros.h +1 -0
  124. package/include/glib-2.0/glib/gmessages.h +11 -0
  125. package/include/glib-2.0/glib/gpathbuf.h +0 -7
  126. package/include/glib-2.0/glib/gslice.h +2 -0
  127. package/include/glib-2.0/glib/gstdio.h +1 -1
  128. package/include/glib-2.0/glib/gstrfuncs.h +24 -18
  129. package/include/glib-2.0/glib/gstrvbuilder.h +4 -8
  130. package/include/glib-2.0/glib/gtestutils.h +5 -0
  131. package/include/glib-2.0/glib/gthread.h +216 -3
  132. package/include/glib-2.0/glib/gunicode.h +12 -2
  133. package/include/glib-2.0/glib/gvarianttype.h +1 -10
  134. package/include/glib-2.0/glib/gversionmacros.h +9 -0
  135. package/include/glib-2.0/glib/gwin32.h +4 -4
  136. package/include/glib-2.0/glib-unix.h +214 -0
  137. package/include/glib-2.0/gmodule/gmodule-visibility.h +34 -0
  138. package/include/glib-2.0/gobject/gbinding.h +0 -8
  139. package/include/glib-2.0/gobject/gbindinggroup.h +0 -8
  140. package/include/glib-2.0/gobject/gclosure.h +1 -9
  141. package/include/glib-2.0/gobject/genums.h +6 -6
  142. package/include/glib-2.0/gobject/glib-types.h +44 -0
  143. package/include/glib-2.0/gobject/gobject-autocleanups.h +4 -0
  144. package/include/glib-2.0/gobject/gobject-visibility.h +34 -0
  145. package/include/glib-2.0/gobject/gobject.h +1 -16
  146. package/include/glib-2.0/gobject/gparam.h +3 -12
  147. package/include/glib-2.0/gobject/gsignal.h +16 -6
  148. package/include/glib-2.0/gobject/gsignalgroup.h +0 -8
  149. package/include/glib-2.0/gobject/gtype.h +53 -20
  150. package/include/glib-2.0/gobject/gtypemodule.h +0 -7
  151. package/include/glib-2.0/gobject/gtypeplugin.h +0 -6
  152. package/include/glib-2.0/gobject/gvaluearray.h +0 -7
  153. package/include/glib-2.0/gobject/gvaluecollector.h +1 -11
  154. package/include/glib-2.0/gobject/gvaluetypes.h +2 -0
  155. package/include/hwy/aligned_allocator.h +171 -6
  156. package/include/hwy/base.h +1765 -543
  157. package/include/hwy/cache_control.h +24 -6
  158. package/include/hwy/detect_compiler_arch.h +23 -2
  159. package/include/hwy/detect_targets.h +56 -13
  160. package/include/hwy/foreach_target.h +24 -0
  161. package/include/hwy/highway.h +20 -3
  162. package/include/hwy/ops/arm_neon-inl.h +1086 -667
  163. package/include/hwy/ops/arm_sve-inl.h +1091 -235
  164. package/include/hwy/ops/emu128-inl.h +271 -196
  165. package/include/hwy/ops/generic_ops-inl.h +2270 -399
  166. package/include/hwy/ops/ppc_vsx-inl.h +1786 -563
  167. package/include/hwy/ops/rvv-inl.h +1043 -311
  168. package/include/hwy/ops/scalar-inl.h +189 -159
  169. package/include/hwy/ops/set_macros-inl.h +66 -6
  170. package/include/hwy/ops/shared-inl.h +175 -56
  171. package/include/hwy/ops/wasm_128-inl.h +153 -136
  172. package/include/hwy/ops/x86_128-inl.h +1647 -646
  173. package/include/hwy/ops/x86_256-inl.h +1003 -370
  174. package/include/hwy/ops/x86_512-inl.h +948 -353
  175. package/include/hwy/per_target.h +4 -0
  176. package/include/hwy/profiler.h +648 -0
  177. package/include/hwy/robust_statistics.h +2 -2
  178. package/include/hwy/targets.h +18 -11
  179. package/include/hwy/timer.h +11 -0
  180. package/include/lcms2.h +46 -7
  181. package/include/lcms2_plugin.h +4 -4
  182. package/include/libheif/heif_version.h +2 -2
  183. package/include/libpng16/png.h +32 -29
  184. package/include/libpng16/pngconf.h +2 -2
  185. package/include/libpng16/pnglibconf.h +7 -2
  186. package/include/librsvg-2.0/librsvg/rsvg-version.h +2 -2
  187. package/include/libxml2/libxml/HTMLparser.h +23 -0
  188. package/include/libxml2/libxml/SAX.h +0 -2
  189. package/include/libxml2/libxml/SAX2.h +0 -2
  190. package/include/libxml2/libxml/c14n.h +0 -2
  191. package/include/libxml2/libxml/dict.h +1 -0
  192. package/include/libxml2/libxml/encoding.h +16 -14
  193. package/include/libxml2/libxml/entities.h +4 -0
  194. package/include/libxml2/libxml/globals.h +15 -503
  195. package/include/libxml2/libxml/hash.h +57 -61
  196. package/include/libxml2/libxml/nanoftp.h +2 -2
  197. package/include/libxml2/libxml/parser.h +137 -18
  198. package/include/libxml2/libxml/parserInternals.h +1 -0
  199. package/include/libxml2/libxml/relaxng.h +2 -1
  200. package/include/libxml2/libxml/schemasInternals.h +1 -0
  201. package/include/libxml2/libxml/schematron.h +1 -0
  202. package/include/libxml2/libxml/threads.h +4 -11
  203. package/include/libxml2/libxml/tree.h +68 -20
  204. package/include/libxml2/libxml/uri.h +2 -1
  205. package/include/libxml2/libxml/valid.h +2 -0
  206. package/include/libxml2/libxml/xmlIO.h +65 -13
  207. package/include/libxml2/libxml/xmlerror.h +37 -8
  208. package/include/libxml2/libxml/xmlmemory.h +37 -40
  209. package/include/libxml2/libxml/xmlreader.h +6 -0
  210. package/include/libxml2/libxml/xmlregexp.h +2 -9
  211. package/include/libxml2/libxml/xmlsave.h +9 -0
  212. package/include/libxml2/libxml/xmlschemas.h +3 -0
  213. package/include/libxml2/libxml/xmlversion.h +28 -43
  214. package/include/libxml2/libxml/xpath.h +1 -1
  215. package/include/libxml2/libxml/xpathInternals.h +2 -1
  216. package/include/libxml2/libxml/xpointer.h +5 -4
  217. package/include/pango-1.0/pango/pango-features.h +3 -3
  218. package/include/pango-1.0/pango/pango-fontmap.h +7 -0
  219. package/include/pixman-1/pixman-version.h +3 -3
  220. package/include/pixman-1/pixman.h +9 -2
  221. package/include/png.h +32 -29
  222. package/include/pngconf.h +2 -2
  223. package/include/pnglibconf.h +7 -2
  224. package/include/vips/connection.h +9 -3
  225. package/include/vips/util.h +0 -9
  226. package/include/vips/version.h +4 -4
  227. package/include/zconf.h +3 -0
  228. package/include/zlib.h +3 -3
  229. package/package.json +1 -1
  230. package/versions.json +15 -15
@@ -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
  * }
@@ -2265,6 +2267,16 @@ static void type_name##_class_intern_init (gpointer klass) \
2265
2267
  }
2266
2268
  #endif /* GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 */
2267
2269
 
2270
+ #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_80
2271
+ #define _g_type_once_init_type GType
2272
+ #define _g_type_once_init_enter g_once_init_enter_pointer
2273
+ #define _g_type_once_init_leave g_once_init_leave_pointer
2274
+ #else /* if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_80 */
2275
+ #define _g_type_once_init_type gsize
2276
+ #define _g_type_once_init_enter g_once_init_enter
2277
+ #define _g_type_once_init_leave g_once_init_leave
2278
+ #endif /* GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_80 */
2279
+
2268
2280
  /* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
2269
2281
  #define _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE(TypeName, type_name, TYPE_PARENT) \
2270
2282
  \
@@ -2286,15 +2298,15 @@ type_name##_get_instance_private (TypeName *self) \
2286
2298
  GType \
2287
2299
  type_name##_get_type (void) \
2288
2300
  { \
2289
- static gsize static_g_define_type_id = 0;
2301
+ static _g_type_once_init_type static_g_define_type_id = 0;
2290
2302
  /* Prelude goes here */
2291
2303
 
2292
2304
  /* Added for _G_DEFINE_TYPE_EXTENDED_WITH_PRELUDE */
2293
2305
  #define _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
2294
- if (g_once_init_enter (&static_g_define_type_id)) \
2306
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2295
2307
  { \
2296
2308
  GType g_define_type_id = type_name##_get_type_once (); \
2297
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2309
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2298
2310
  } \
2299
2311
  return static_g_define_type_id; \
2300
2312
  } /* closes type_name##_get_type() */ \
@@ -2334,8 +2346,8 @@ static void type_name##_default_init (TypeName##Interface *klass); \
2334
2346
  GType \
2335
2347
  type_name##_get_type (void) \
2336
2348
  { \
2337
- static gsize static_g_define_type_id = 0; \
2338
- if (g_once_init_enter (&static_g_define_type_id)) \
2349
+ static _g_type_once_init_type static_g_define_type_id = 0; \
2350
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2339
2351
  { \
2340
2352
  GType g_define_type_id = \
2341
2353
  g_type_register_static_simple (G_TYPE_INTERFACE, \
@@ -2351,7 +2363,7 @@ type_name##_get_type (void) \
2351
2363
  #define _G_DEFINE_INTERFACE_EXTENDED_END() \
2352
2364
  /* following custom code */ \
2353
2365
  } \
2354
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2366
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2355
2367
  } \
2356
2368
  return static_g_define_type_id; \
2357
2369
  } /* closes type_name##_get_type() */
@@ -2460,11 +2472,11 @@ static GType type_name##_get_type_once (void); \
2460
2472
  GType \
2461
2473
  type_name##_get_type (void) \
2462
2474
  { \
2463
- static gsize static_g_define_type_id = 0; \
2464
- if (g_once_init_enter (&static_g_define_type_id)) \
2475
+ static _g_type_once_init_type static_g_define_type_id = 0; \
2476
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2465
2477
  { \
2466
2478
  GType g_define_type_id = type_name##_get_type_once (); \
2467
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2479
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2468
2480
  } \
2469
2481
  return static_g_define_type_id; \
2470
2482
  } \
@@ -2497,11 +2509,11 @@ static GType type_name##_get_type_once (void); \
2497
2509
  GType \
2498
2510
  type_name##_get_type (void) \
2499
2511
  { \
2500
- static gsize static_g_define_type_id = 0; \
2501
- if (g_once_init_enter (&static_g_define_type_id)) \
2512
+ static _g_type_once_init_type static_g_define_type_id = 0; \
2513
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2502
2514
  { \
2503
2515
  GType g_define_type_id = type_name##_get_type_once (); \
2504
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2516
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2505
2517
  } \
2506
2518
  return static_g_define_type_id; \
2507
2519
  } \
@@ -2550,11 +2562,11 @@ static GType type_name##_get_type_once (void); \
2550
2562
  GType \
2551
2563
  type_name##_get_type (void) \
2552
2564
  { \
2553
- static gsize static_g_define_type_id = 0; \
2554
- if (g_once_init_enter (&static_g_define_type_id)) \
2565
+ static _g_type_once_init_type static_g_define_type_id = 0; \
2566
+ if (_g_type_once_init_enter (&static_g_define_type_id)) \
2555
2567
  { \
2556
2568
  GType g_define_type_id = type_name##_get_type_once (); \
2557
- g_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2569
+ _g_type_once_init_leave (&static_g_define_type_id, g_define_type_id); \
2558
2570
  } \
2559
2571
  return static_g_define_type_id; \
2560
2572
  } \
@@ -2698,6 +2710,27 @@ const gchar * g_type_name_from_class (GTypeClass *g_class);
2698
2710
  */
2699
2711
  #define G_TYPE_FLAG_RESERVED_ID_BIT ((GType) (1 << 0))
2700
2712
 
2713
+ /**
2714
+ * GPOINTER_TO_TYPE:
2715
+ * @p: The pointer to convert to a #GType
2716
+ *
2717
+ * This macro should be used instead of GPOINTER_TO_SIZE() to ensure
2718
+ * portability since #GType is not guaranteed to be the same as #gsize.
2719
+ *
2720
+ * Since: 2.80
2721
+ */
2722
+ #define GPOINTER_TO_TYPE(p) ((GType) (guintptr) (p)) GOBJECT_AVAILABLE_MACRO_IN_2_80
2723
+ /**
2724
+ * GTYPE_TO_POINTER:
2725
+ * @t: The #GType to convert to a pointer
2726
+ *
2727
+ * This macro should be used instead of GSIZE_TO_POINTER() to ensure
2728
+ * portability since #GType is not guaranteed to be the same as #gsize.
2729
+ *
2730
+ * Since: 2.80
2731
+ */
2732
+ #define GTYPE_TO_POINTER(t) ((gpointer) (guintptr) (t)) GOBJECT_AVAILABLE_MACRO_IN_2_80
2733
+
2701
2734
  G_END_DECLS
2702
2735
 
2703
2736
  #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_