Re: man malloc

2005-08-19 Thread Giorgos Keramidas
On 2005-08-19 15:00, Dmitry Mityugov <[EMAIL PROTECTED]> wrote: >On 8/19/05, Giorgos Keramidas <[EMAIL PROTECTED]> wrote: >>On 2005-08-18 22:17, Dmitry Mityugov <[EMAIL PROTECTED]> wrote: >>>On 8/18/05, Giorgos Keramidas <[EMAIL PROTECTED]> wrote: It may be surprising, but casting back and for

Re: man malloc

2005-08-19 Thread Dmitry Mityugov
On 8/19/05, Giorgos Keramidas <[EMAIL PROTECTED]> wrote: > On 2005-08-18 22:17, Dmitry Mityugov <[EMAIL PROTECTED]> wrote: > >On 8/18/05, Giorgos Keramidas <[EMAIL PROTECTED]> wrote: ... > >> It may be surprising, but casting back and forth *MAY* change the value > >> of the pointer. > >... > > > >

Re: man malloc

2005-08-19 Thread Giorgos Keramidas
On 2005-08-18 22:17, Dmitry Mityugov <[EMAIL PROTECTED]> wrote: >On 8/18/05, Giorgos Keramidas <[EMAIL PROTECTED]> wrote: >>On 2005-08-18 12:08, Sergey Matveychuk <[EMAIL PROTECTED]> wrote: >>>Chuck Swiger wrote: >What is pointer coercion? I have no pointer before malloc() returns. Ri

Re: man malloc

2005-08-18 Thread Dmitry Mityugov
On 8/18/05, Giorgos Keramidas <[EMAIL PROTECTED]> wrote: > On 2005-08-18 12:08, Sergey Matveychuk <[EMAIL PROTECTED]> wrote: > >Chuck Swiger wrote: > >>>What is pointer coercion? I have no pointer before malloc() returns. > >> > >> Right. Well, malloc returns a (void *), but most people want to us

Re: man malloc

2005-08-18 Thread Giorgos Keramidas
On 2005-08-18 12:08, Sergey Matveychuk <[EMAIL PROTECTED]> wrote: >Chuck Swiger wrote: >>>What is pointer coercion? I have no pointer before malloc() returns. >> >> Right. Well, malloc returns a (void *), but most people want to use the >> memory malloc returns to hold their own arrays, structs, w

Re: man malloc

2005-08-18 Thread Sergey Matveychuk
Chuck Swiger wrote: What does "suitable aligned for storage of *any* type of object" means? On some platforms, it is either desirable or required that, say, a 8-byte double is stored at a memory location which is is also aligned to 8-bytes: Oh, it was told for different architectures. It'

RE: man malloc

2005-08-17 Thread Joshua Weaver
- > From: [EMAIL PROTECTED] [mailto:owner-freebsd- > [EMAIL PROTECTED] On Behalf Of Erik Trulsson > Sent: Wednesday, August 17, 2005 4:33 PM > To: Sergey Matveychuk > Cc: [EMAIL PROTECTED] > Subject: Re: man malloc > > On Thu, Aug 18, 2005 at 01:03:46AM +0400, Sergey Matvey

Re: man malloc

2005-08-17 Thread Chuck Swiger
Sergey Matveychuk wrote: I know it may be stupid, but I can't understand this sentence from malloc(3) man page: " The allocated space is suitably aligned (after possible pointer coercion) for storage of any type of object. " What does "suitable aligned for storage of *any* type of object" me

Re: man malloc

2005-08-17 Thread Erik Trulsson
On Thu, Aug 18, 2005 at 01:03:46AM +0400, Sergey Matveychuk wrote: > I know it may be stupid, but I can't understand this sentence from > malloc(3) man page: > > " > The allocated space is suitably aligned (after possible pointer > coercion) for storage of any type of object. > " > > What does

man malloc

2005-08-17 Thread Sergey Matveychuk
I know it may be stupid, but I can't understand this sentence from malloc(3) man page: " The allocated space is suitably aligned (after possible pointer coercion) for storage of any type of object. " What does "suitable aligned for storage of *any* type of object" means? What is pointer coerc