Skip to content

Commit

Permalink
Replace assert with RUBY_ASSERT in darray.h
Browse files Browse the repository at this point in the history
assert does not print the bug report, only the file and line number of
the assertion that failed. RUBY_ASSERT prints the full bug report, which
makes it much easier to debug.
  • Loading branch information
peterzhu2118 committed Feb 12, 2024
1 parent 7256e38 commit 11ffee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion darray.h
Expand Up @@ -196,7 +196,7 @@ rb_darray_resize_capa_impl(void *ptr_to_ary, size_t new_capa, size_t header_size
new_ary->size = 0;
}

assert(new_ary->size <= new_capa);
RUBY_ASSERT(new_ary->size <= new_capa);

new_ary->capa = new_capa;

Expand Down

0 comments on commit 11ffee8

Please sign in to comment.