Skip to content

Commit

Permalink
[DOC] Improve documentation to RB_ALLOCV
Browse files Browse the repository at this point in the history
Although the storage of the opaque Ruby object is an array of VALUEs, the intention of RB_ALLOCV is to allocate bytes of memory.
  • Loading branch information
larskanis authored and shyouhei committed Dec 6, 2022
1 parent 8c62b36 commit 81e274c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/ruby/internal/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@ typedef uint128_t DSIZE_T;
RBIMPL_CAST((type *)alloca(rbimpl_size_mul_or_raise(sizeof(type), (n))))

/**
* Identical to #RB_ALLOCV_N(), except it implicitly assumes the type of array
* is ::VALUE.
* Identical to #RB_ALLOCV_N(), except that it allocates a number of bytes and
* returns a void* .
*
* @param v A variable to hold the just-in-case opaque Ruby object.
* @param n Size of allocation, in bytes.
* @return An array of `n` bytes of ::VALUE.
* @return A void pointer to `n` bytes storage.
* @note `n` may be evaluated twice.
*/
#define RB_ALLOCV(v, n) \
Expand Down

0 comments on commit 81e274c

Please sign in to comment.