All of lore.kernel.org
 help / color / mirror / Atom feed
* platform_ops.malloc() vs. realloc()
@ 2007-02-22 10:14 Geert Uytterhoeven
  2007-02-22 10:25 ` David Gibson
  2007-02-22 10:31 ` Segher Boessenkool
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2007-02-22 10:14 UTC (permalink / raw)
  To: Linux/PPC Development


arch/powerpc/boot/ops.h has:

| /* Platform specific operations */
| struct platform_ops {
|         void    (*fixups)(void);
|         void    (*image_hdr)(const void *);
|         void *  (*malloc)(u32 size);
|         void    (*free)(void *ptr);
|         void *  (*realloc)(void *ptr, unsigned long size);
|         void    (*exit)(void);
| };

Is there a specific reason why the size parameters of malloc() and realloc()
differ in type?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: platform_ops.malloc() vs. realloc()
  2007-02-22 10:14 platform_ops.malloc() vs. realloc() Geert Uytterhoeven
@ 2007-02-22 10:25 ` David Gibson
  2007-02-22 10:31 ` Segher Boessenkool
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2007-02-22 10:25 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/PPC Development

On Thu, Feb 22, 2007 at 11:14:36AM +0100, Geert Uytterhoeven wrote:
> 
> arch/powerpc/boot/ops.h has:
> 
> | /* Platform specific operations */
> | struct platform_ops {
> |         void    (*fixups)(void);
> |         void    (*image_hdr)(const void *);
> |         void *  (*malloc)(u32 size);
> |         void    (*free)(void *ptr);
> |         void *  (*realloc)(void *ptr, unsigned long size);
> |         void    (*exit)(void);
> | };
> 
> Is there a specific reason why the size parameters of malloc() and realloc()
> differ in type?

Not as far as I'm aware, I believe it's just a wart.  The zImage is
always compiler 32-bit, so they're actually the same thing.  I'm
actually hoping to get rid of malloc() and realloc() at some point.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: platform_ops.malloc() vs. realloc()
  2007-02-22 10:14 platform_ops.malloc() vs. realloc() Geert Uytterhoeven
  2007-02-22 10:25 ` David Gibson
@ 2007-02-22 10:31 ` Segher Boessenkool
  1 sibling, 0 replies; 3+ messages in thread
From: Segher Boessenkool @ 2007-02-22 10:31 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/PPC Development

> |         void *  (*malloc)(u32 size);

> |         void *  (*realloc)(void *ptr, unsigned long size);

> Is there a specific reason why the size parameters of malloc() and 
> realloc()
> differ in type?

There are good arguments to prefer either u32 or unsigned
long, so maybe the current situation is a compromise ;-P


Segher

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-22 10:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-22 10:14 platform_ops.malloc() vs. realloc() Geert Uytterhoeven
2007-02-22 10:25 ` David Gibson
2007-02-22 10:31 ` Segher Boessenkool

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.