no-pointer areas
Craig Black
cblack at ara.com
Tue Oct 24 07:22:13 PDT 2006
"Thomas Kuehne" <thomas-dloop at kuehne.cn> wrote in message
news:slrnejrbvd.79u.thomas-dloop at birke.kuehne.cn...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Craig Black schrieb am 2006-10-23:
>>
>> Overall a very, very good idea.
>> However, why does the bytes allocated per element have to be the
>> qualification?
>> This seems a bit convoluted to me. Why not just add a parameter with a
>> default value?
>>
>> void *malloc(size_t size, int hasPtr = 1);
>
> That's what malloc_no_ptr was meant for, using a default parameter
> might be more useful though. Using int seems strange, how about:
>
> void *malloc(size_t size, bool hasPtr = true);
Yeah bool is more appropriate. However, bool isn't a C type is it? I don't
know if we are limited to using C stuff for the C runtime in order to
maintain C compatibility.
Anyway, if not this exact approach, something like this really needs to be
done to improve GC performance. Anything we can do to optimize it is
crucial, since GC is D's biggest performance bottleneck.
-Craig
More information about the Digitalmars-d
mailing list