[ruby-core:63953] Re: [ruby-trunk - Feature #10082] [PATCH] add ZALLOC* macros to reduce ALLOC + MEMZERO calls

From: Eric Wong <normalperson@...>
Date: 2014-07-23 07:19:49 UTC
List: ruby-core #63953
tad.a.digger@gmail.com wrote:
> The basic policy of patch feels great, but why don't you name CALLOC?
> 
> I feel CALLOC is more straitforward because calloc(3) is in the standard and
> ZALLOC(_N) already uses calloc().

I considered ZALLOC_N == CALLOC, but the arguments are reversed
for calloc(3), so I didn't want to risk that confusion, either.

I chose ZALLOC based on kzalloc/kmem_cache_zalloc in the Linux kernel.

On a related note: maybe RB_ZALLOC or RUBY_ZALLOC would be better, but
that would be inconsistent with existing ALLOC(_N) and REALLOC_N, too.

Naming is hard :<

matz/ko1 can make the final decision.

I'll commit in a day or so if we cannot decide, the name may still
change after commit.

In This Thread

Prev Next