Path: csiph.com!news.mixmin.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Wed, 20 Jul 2016 14:38:11 -0500 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: A glitch regarding the usual malloc() idiom References: <4cd22745-22ad-4ac7-bdba-39ffa1c75e13@googlegroups.com> <7d995799-5f23-4784-a62e-ea423de00650@googlegroups.com> Date: Wed, 20 Jul 2016 20:38:11 +0100 Message-ID: <87k2gg2j8c.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:mlqH5zbNAxza+P/jkvifzCgzBZI= MIME-Version: 1.0 Content-Type: text/plain Lines: 12 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-PFJs8RCOVAombHHdSoI/Ja4FMNJKVPFOsR3bk/BPp6ZRPHAPxQCgy3zfTmWyQBNXqppUIny0a89pGLG!XiZPIQsGzVSsSVxZ2ymScov0tfz4MyNhTyN1Kmp+wNM3eEgPM2MTEbemleYlxH6vPpU= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1511 Xref: csiph.com comp.lang.c:90687 Richard Heathfield writes: >> It's the double abstraction problem >> >> magptr = malloc(40 * sizeof(float)); >> >> tells us that we are asking for 160 bytes of memory. > > No, it doesn't. It tells us we're asking for 40 * sizeof(float) bytes > of memory. Supremely confident idiot.