[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] rounding off the heap size_t change to allow initi
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] rounding off the heap size_t change to allow initial large heaps |
Date: |
Mon, 25 Mar 2013 20:47:19 +0100 |
User-agent: |
Mutt/1.4.2.3i |
On Sun, Mar 24, 2013 at 04:32:56PM -0400, Andrei Barbu wrote:
> Hi,
>
> I've attached a patch that allows for initial large heaps given that
> heap is now a size_t.
>
> The original patch did not update CHICKEN_initialize to have a size_t heap.
I'm not sure this can "just" be done or requires a CR, since this is a
potentially breaking change. At least it breaks the ABI, but it might
also break the API though AFAIK size_t should always only be larger than
int so I doubt this is really a problem. OTOH, the original change
isn't documented in the NEWS either, so it must not have been considered
an important change.
Anyone?
> -C_fctexport int CHICKEN_initialize(int heap, int stack, int symbols,
> void *toplevel);
> +C_fctexport int CHICKEN_initialize(size_t heap, int stack, int
> symbols, void *toplevel);
>
> The patch also did not update the debugging message in
> C_set_or_change_heap_size.
> - C_dbg(C_text("debug"), C_text("heap resized to %d bytes\n"), (int)heap);
> + C_dbg(C_text("debug"), C_text("heap resized to %zu bytes\n"), heap);
> %zu is a C99-ism, I don't know if people are ok with that.
So far, generally we've avoided these because they're not very portable.
We don't really have an official policy on this, but I guess if we're
going to use size_t consistently, we should use the matching printf
specifiers too.
The patch itself is fine, so at least here's a signed-off version, which
can be pushed as soon as we've figured out how to do this.
Cheers,
Peter
--
http://www.more-magic.net
0001-623c46bea299fa8fb2e5702661a8e3def1016984-didn-t-make.patch
Description: Text document