Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bo Persson Newsgroups: comp.lang.c++ Subject: Re: Examples of current platforms/architectures where sizeof(void*) > sizeof(int*) ? Date: Wed, 1 Sep 2021 21:55:21 +0200 Lines: 14 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net IQ4+TZTZx4kDLfUoF08i4gTaJkPGZfpNmdaUBJp6nBO3wHERId Cancel-Lock: sha1:f5Fn+kQNINf9Ja2ynyNx9yhBNr4= User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: Content-Language: sv Xref: csiph.com comp.lang.c++:81002 On 2021-09-01 at 20:34, Bonita Montero wrote: > Am 01.09.2021 um 20:14 schrieb Juha Nieminen: > >> Thus, I wouldn't be surprised if malloc() (and new) always returns >> a block that's aligned at a very minimum to the size of a pointer. > > malloc() returns a pointer which is aligned at least to max_align_t: > https://en.cppreference.com/w/c/types/max_align_t Not entirely correct. The allocated storage must be properly aligned for an object of that size. So if smaller than a long double, it can also be less aligned.