mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-14 00:06:24 +01:00
Merge branch 'wip/smcv/pointers-can-be-large' into 'main'
docs: Stop claiming that gsize is wide enough to hold a pointer See merge request GNOME/glib!3000
This commit is contained in:
commit
7b05defa0e
17
glib/docs.c
17
glib/docs.c
@ -515,13 +515,22 @@
|
|||||||
/**
|
/**
|
||||||
* gsize:
|
* gsize:
|
||||||
*
|
*
|
||||||
* An unsigned integer type of the result of the sizeof operator,
|
* An unsigned integer type of the result of the `sizeof` operator,
|
||||||
* corresponding to the size_t type defined in C99.
|
* corresponding to the `size_t` type defined in C99.
|
||||||
* This type is wide enough to hold the numeric value of a pointer,
|
*
|
||||||
* so it is usually 32 bit wide on a 32-bit platform and 64 bit wide
|
* It is usually 32 bit wide on a 32-bit platform and 64 bit wide
|
||||||
* on a 64-bit platform. Values of this type can range from 0 to
|
* on a 64-bit platform. Values of this type can range from 0 to
|
||||||
* %G_MAXSIZE.
|
* %G_MAXSIZE.
|
||||||
*
|
*
|
||||||
|
* This type is wide enough to hold the size of the largest possible
|
||||||
|
* memory allocation, but is not guaranteed to be wide enough to hold
|
||||||
|
* the numeric value of a pointer: on platforms that use tagged pointers,
|
||||||
|
* such as [CHERI](https://cheri-cpu.org/), pointers can be numerically
|
||||||
|
* larger than the size of the address space.
|
||||||
|
* If the numeric value of a pointer needs to be stored in an integer
|
||||||
|
* without information loss, use the standard C types `intptr_t` or
|
||||||
|
* `uintptr_t`, or the similar GLib types #gintptr or #guintptr.
|
||||||
|
*
|
||||||
* To print or scan values of this type, use
|
* To print or scan values of this type, use
|
||||||
* %G_GSIZE_MODIFIER and/or %G_GSIZE_FORMAT.
|
* %G_GSIZE_MODIFIER and/or %G_GSIZE_FORMAT.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user