tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Removing the horrible CString hack


From: Edmund Grimley Evans
Subject: Re: [Tinycc-devel] Removing the horrible CString hack
Date: Sun, 22 Nov 2015 00:29:51 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

David Mertens <address@hidden>:

> Doesn't this assume that ints are 4 bytes?

Yes. I've heard that there are systems that have sizeof(int) == 8,
though I've not used such a system.

> What I'm not sure about, and would appreciate if somebody could check, is
> whether changing the contents of the union might lead to substantial increases
> in memory consumption. How many CValue-s are typically allocated and used
> during a regular compilation?

I'm not sure, but perhaps not very many.

> The proposed change will alter a union the
> largest member of which used to be a pointer or 64-bit integer, and replaced 
> it
> with a struct that contains an int and two pointers.

No, the largest member of CValue is the "long double ld" or the "int
tab[LDOUBLE_SIZE/4]" (it looks like sizeof(int) == 4 is assumed
again), which is 8 bytes on arm, 12 bytes on i386, and 16 bytes on
arm64 and x86_64. So on i386 the patch doesn't make CValue any larger,
if I'm not mistaken. Also, if we were to add complex numbers then we
would in any case need space in CValue for twice that.

Edmund



reply via email to

[Prev in Thread] Current Thread [Next in Thread]