Re: sizeof(ptr) = ?



James Kuyper <jameskuyper@xxxxxxxxxxx> writes:

Richard wrote:
James Kuyper <jameskuyper@xxxxxxxxxxx> writes:

Richard Tobin wrote:
In article <7kt3v4-2fi.ln1@xxxxxxxx>,
To answer the associated question: malloc() knows which memory type to
allocate, because the only memory types it's allowed to allocate are
memory types that can be used to construct objects of any type. If
there is no such memory on a given machine, malloc() can only return a
null pointer, which renders it pretty useless.

Which is fair enough and obvious. I was making the point that a few core
users constantly mention that pointers can (theoretically) point to
different "types of memory". I think its pretty done to death now I guess.

I can't see any reason why that wouldn't be possible, but when you
brought that concept into the discussion, you should have indicated
that you were doing so; up until your message the context of the
discussion was much broader than just those particular kinds of
implementations, and at least some of us thought you were still
discussing that broader context.

I clarified this about 7 posts back in the thread to be fair.
.



Relevant Pages

  • Re: sizeof(ptr) = ?
    ... allocate, because the only memory types it's allowed to allocate are ... memory types that can be used to construct objects of any type. ... null pointer, ... I can't see any reason why that wouldn't be possible, but when you brought that concept into the discussion, you should have indicated that you were doing so; up until your message the context of the discussion was much broader than just those particular kinds of implementations, and at least some of us thought you were still discussing that broader context. ...
    (comp.lang.c)
  • Re: sizeof(ptr) = ?
    ... allocate, because the only memory types it's allowed to allocate are ... memory types that can be used to construct objects of any type. ... null pointer, ...
    (comp.lang.c)
  • Re: sizeof(ptr) = ?
    ... allocate, because the only memory types it's allowed to allocate are ... memory types that can be used to construct objects of any type. ... Malloc() is going to be the least of your problems. ...
    (comp.lang.c)
  • Re: Question about FILE_OBJECT
    ... create a context in create and freed in close and have this context contain ... the list of contexts that you allocate on an IOCTL basis. ... change and my validation of the context object would fail even though the ... PFILE_OBJECT pointer and the same pointer value you put into ...
    (microsoft.public.win32.programmer.kernel)

Loading