Path: csiph.com!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Oliver Schmidt
Newsgroups: comp.sys.apple2.programmer
Subject: Re: malloc with cc65
Date: Sat, 16 Dec 2023 00:43:49 -0000 (UTC)
Message-ID:
References: <20231214135300.3f65fe0f@smilodon-gracilis> <20231214215955.353cd4e4@smilodon-gracilis>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 16 Dec 2023 00:43:49 -0000 (UTC)
Injection-Info: solani.org; logging-data="147300"; mail-complaints-to="abuse@news.solani.org"
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:EL/pKSGCTh9HA/yBPA/WfCIXXYs= sha1:hKuJN1GhN36r0woukN4XpMvKzeo=
X-User-ID: eJwNyMEBwCAIA8CVEEhqx0Eh+4/Q3vMQXLxPEkwI2pYO+p9UDFQ9uU7aDA9Vuavi7RpD40r+ARNlEY0=
Xref: csiph.com comp.sys.apple2.programmer:6283
Hi Bill,
>> 2. The cc65 optimizer (always compile with -O) knows about "pointer
>> constants" (in contrast to pointer variables) so the code to access
>> them is usually faster/smaller.
> I'm not sure where a pointer constant would be used in a C program.
I meant the term in this sense...
An integer variable:
int a
An integer constant:
5
Setting the variable to the constant:
a = 5
A pointer variable:
int *b
A pointer constant:
int c[10]
Setting the variable to the constant:
b = c
What I state above means that using c is faster/smaller than using b like
this:
*c = 2
*b = 2
Regards,
Oliver