From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 16 Aug 2012 16:50:27 +0200 Subject: [U-Boot] Early malloc() summary In-Reply-To: <502CE008.8030808@gmail.com> References: <502CE008.8030808@gmail.com> Message-ID: <201208161650.27985.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Graeme Russ, [...] > >> 2) We can pass a pointer to a driver_core struct (or whatever struct it > >> > >> is that holds the 'reloc' helper function pointer). We can't pick up > >> misuse at compile time, but dm_malloc() can print a meaningful > >> message if it is called pre-relocation with no relocation function. > >> (We should add a flag to indicate that no relocation helper is > >> required which may be the case for very simple drivers) > > > > Yes, but it would prevent using dm_malloc(size_t size, driver *drv) > > for one-time buffers inside helper functions - strdup() for instance, > > Hmm, I hadn't thought of that So, we're back to square 1 ? [...] Best regards, Marek Vasut