1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

include/ruby/internal/xmalloc.h: document rb_eNoMemError

It was my bad, the exception that actually raises is rb_eNoMemError.
[ci skip]
This commit is contained in:
卜部昌平 2020-12-14 16:54:12 +09:00
parent 11656d15e2
commit fe60480947

View file

@ -62,7 +62,7 @@ RBIMPL_ATTR_ALLOC_SIZE((1))
* - In case of `ENOMEM` it tries to GC to make some room. * - In case of `ENOMEM` it tries to GC to make some room.
* *
* @param[in] size Requested amount of memory. * @param[in] size Requested amount of memory.
* @exception rb_eMemError No space left for `size` bytes allocation. * @exception rb_eNoMemError No space left for `size` bytes allocation.
* @return A valid pointer to an allocated storage instance; which has at * @return A valid pointer to an allocated storage instance; which has at
* least `size` bytes width, with appropriate alignment detected by * least `size` bytes width, with appropriate alignment detected by
* the underlying malloc() routine. * the underlying malloc() routine.
@ -91,7 +91,7 @@ RBIMPL_ATTR_ALLOC_SIZE((1,2))
* *
* @param[in] nelems Number of elements. * @param[in] nelems Number of elements.
* @param[in] elemsiz Size of an element. * @param[in] elemsiz Size of an element.
* @exception rb_eMemError No space left for allocation. * @exception rb_eNoMemError No space left for allocation.
* @exception rb_eArgError `nelems` * `elemsiz` would overflow. * @exception rb_eArgError `nelems` * `elemsiz` would overflow.
* @return A valid pointer to an allocated storage instance; which has at * @return A valid pointer to an allocated storage instance; which has at
* least `nelems` * `elemsiz` bytes width, with appropriate * least `nelems` * `elemsiz` bytes width, with appropriate
@ -120,7 +120,7 @@ RBIMPL_ATTR_ALLOC_SIZE((1,2))
* *
* @param[in] nelems Number of elements. * @param[in] nelems Number of elements.
* @param[in] elemsiz Size of an element. * @param[in] elemsiz Size of an element.
* @exception rb_eMemError No space left for allocation. * @exception rb_eNoMemError No space left for allocation.
* @exception rb_eArgError `nelems` * `elemsiz` would overflow. * @exception rb_eArgError `nelems` * `elemsiz` would overflow.
* @return A valid pointer to an allocated storage instance; which has at * @return A valid pointer to an allocated storage instance; which has at
* least `nelems` * `elemsiz` bytes width, with appropriate * least `nelems` * `elemsiz` bytes width, with appropriate
@ -146,19 +146,19 @@ RBIMPL_ATTR_ALLOC_SIZE((2))
* *
* @param[in] ptr A valid pointer to a storage instance that was * @param[in] ptr A valid pointer to a storage instance that was
* previously returned from either ruby_xmalloc(), * previously returned from either ruby_xmalloc(),
* ruby_xmalloc2(), ruby_xcalloc(), ruby_xrealloc(), * ruby_xmalloc2(), ruby_xcalloc(),
* or ruby_xrealloc2(). * ruby_xrealloc(), or ruby_xrealloc2().
* @param[in] newsiz Requested new amount of memory. * @param[in] newsiz Requested new amount of memory.
* @exception rb_eMemError No space left for `newsiz` bytes allocation. * @exception rb_eNoMemError No space left for `newsiz` bytes allocation.
* @retval ptr In case the function returns the passed pointer * @retval ptr In case the function returns the passed pointer
* as-is, the storage instance that the pointer holds * as-is, the storage instance that the pointer
* is either grown or shrunken to have at least * holds is either grown or shrunken to have at
* `newsiz` bytes. * least `newsiz` bytes.
* @retval otherwise A valid pointer to a newly allocated storage * @retval otherwise A valid pointer to a newly allocated storage
* instance which has at least `newsiz` bytes width, * instance which has at least `newsiz` bytes
* and holds previous contents of `ptr`. In this * width, and holds previous contents of `ptr`. In
* case `ptr` is invalidated as if it was passed to * this case `ptr` is invalidated as if it was
* ruby_xfree(). * passed to ruby_xfree().
* @note It doesn't return NULL. * @note It doesn't return NULL.
* @warning Unlike some realloc() implementations, passing zero to `elemsiz` * @warning Unlike some realloc() implementations, passing zero to `elemsiz`
* is not the same as calling ruby_xfree(), because this function * is not the same as calling ruby_xfree(), because this function
@ -194,21 +194,22 @@ RBIMPL_ATTR_ALLOC_SIZE((2,3))
* *
* @param[in] ptr A valid pointer to a storage instance that was * @param[in] ptr A valid pointer to a storage instance that was
* previously returned from either ruby_xmalloc(), * previously returned from either ruby_xmalloc(),
* ruby_xmalloc2(), ruby_xcalloc(), ruby_xrealloc(), * ruby_xmalloc2(), ruby_xcalloc(),
* or ruby_xrealloc2(). * ruby_xrealloc(), or ruby_xrealloc2().
* @param[in] newelems Requested new number of elements. * @param[in] newelems Requested new number of elements.
* @param[in] newsiz Requested new size of each element. * @param[in] newsiz Requested new size of each element.
* @exception rb_eMemError No space left for allocation. * @exception rb_eNoMemError No space left for allocation.
* @exception rb_eArgError `newelems` * `newsiz` would overflow. * @exception rb_eArgError `newelems` * `newsiz` would overflow.
* @retval ptr In case the function returns the passed pointer * @retval ptr In case the function returns the passed pointer
* as-is, the storage instance that the pointer holds * as-is, the storage instance that the pointer
* is either grown or shrunken to have at least * holds is either grown or shrunken to have at
* `newelems` * `newsiz` bytes. * least `newelems` * `newsiz` bytes.
* @retval otherwise A valid pointer to a newly allocated storage * @retval otherwise A valid pointer to a newly allocated storage
* instance which has at least `newelems` * `newsiz` * instance which has at least `newelems` *
* bytes width, and holds previous contents of `ptr`. * `newsiz` bytes width, and holds previous
* In this case `ptr` is invalidated as if it was * contents of `ptr`. In this case `ptr` is
* passed to ruby_xfree(). * invalidated as if it was passed to ruby_xfree().
* @note It doesn't return NULL. * @note It doesn't return NULL.
* @warning Unlike some realloc() implementations, passing zero to either * @warning Unlike some realloc() implementations, passing zero to either
* `newelems` or `elemsiz` are not the same as calling * `newelems` or `elemsiz` are not the same as calling