size_t
__builtin_object_size(void *ptr, int type)
)
function is a
gcc(1)
built-in function that returns the size of the
ptr
object if known at compile time and the object does not have any side
effects.
)
function returns:
(size_t)-1type
0
and
1.
(size_t)0type
2
and
3.
If the size of the object is known, then the
__builtin_object_size()
function returns the maximum size of all the objects that the compiler
knows that they can be pointed to by
ptr
when
type
& 2 == 0,
and the minimum size when
type
& 2 != 0.
)
appeared in gcc 4.1.