Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f3c8037-297d-4e5b-a792-b322018ff9d3@cs.ucla.edu>
Date: Wed, 24 Jul 2024 13:03:36 -0700
From: Paul Eggert <eggert@...ucla.edu>
To: libc-coord@...ts.openwall.com, Rich Felker <dalias@...c.org>
Cc: Florian Weimer <fweimer@...hat.com>, enh <enh@...gle.com>,
 Zijun Zhao <zijunzhao@...gle.com>
Subject: Re: aligned_realloc()

On 2024-07-24 11:40, Rich Felker wrote:
>> The memory allocator needn't track the original alignment
>> explicitly. Instead, realloc, when moving data, can allocate
>> replacement memory with the same alignment as the incoming pointer.
>> Although this would likely mean more fragmentation, it might not be
>> all that bad in practice, at least for people who care about
>> alignment more than fragmentation.
> This would be rather unfortunate if the object passed just happened to
> have address 0x80000000 (or analogous for however many bits of a
> 64-bit address space are usable). Certainly could happen by chance

Of course, but the chances are low. And if you're worried about it, 
don't let malloc hand out those rare addresses. That wouldn't be hard.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.