Thread: heap

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    2

    heap

    i want to know about far heap and near heap
    and far poniter and hug poniter
    thx

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    As far as I know, hug ponitor was the yellow bear from Care Bears. far ponitor was his girlfriend. There wasn't much character development so I can't say too much more about them.
    If you understand what you're doing, you're not learning anything.

  3. #3
    ---
    Join Date
    May 2004
    Posts
    1,379
    har har

    m_adel I assume you are using a compiler like Turbo C? Well don't and you won't even have to worry about far and huge.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Far and huge pointers are hold-overs from the era of 16 bit computing. Back in the day of DOS and Win3.11 CPU registers were 16 bits, and pointers were only 16 bits as well. If your program needed more than 64K of addressable memory, a 16 bit pointer would not work (remember 16 bits can only count to 65535). Therefore there were far and huge pointers which were 32 bits in size and which used two registers. Once computers passed into the realm of 32 bit computing, far and huge pointers became redundant since now all pointers are 32 bits.

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    far and huge pointers became redundant since now all pointers are 32 bits.
    I wouldn't go that far. I'm sure you've heard that there are 64bit processors out?
    Quote Originally Posted by AMD
    Linkylink
    Data Types

    The Linux ABI for x86 specifies that long, int, and pointer data types are all 4 bytes long. The ABI for AMD64 architecture also specifies int as 4 bytes, but long and pointer data types are each 8 bytes long. The common x86 practice of using an unsigned int to represent a pointer causes the most bugs when recompiling drivers to AMD64 architecture. The correct Linux idiom is to use an unsigned long, which is defined to be the size of an general purpose register in the current architecture.
    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    .
    Join Date
    Nov 2003
    Posts
    307
    ptrdiff_t should be a suitable datatype type for a pointer under all architectures.

    On HPUX PA RISC boxes ptrdiff_t correctly defined in both 32 and 64 bit implementations. And on the same machine. For example.

  7. #7
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Huh?

    Code:
    itsme@dreams:~/C$ cat ptrdiff.c
    #include <stdio.h>
    
    int main(void)
    {
      ptrdiff_t foo;
    
      return 0;
    }
    itsme@dreams:~/C$ gcc -Wall ptrdiff.c -o ptrdiff
    ptrdiff.c: In function `main':
    ptrdiff.c:5: `ptrdiff_t' undeclared (first use in this function)
    ptrdiff.c:5: (Each undeclared identifier is reported only once
    ptrdiff.c:5: for each function it appears in.)
    ptrdiff.c:5: parse error before `foo'
    itsme@dreams:~/C$
    If you understand what you're doing, you're not learning anything.

  8. #8
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Code:
    #include <stddef.h>
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  9. #9
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Ahh...works now =)
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. heap
    By George2 in forum Windows Programming
    Replies: 2
    Last Post: 11-10-2007, 11:49 PM
  2. Heap Work
    By AndyBomstad in forum C++ Programming
    Replies: 1
    Last Post: 05-16-2005, 12:09 PM
  3. Do you know...
    By davejigsaw in forum C++ Programming
    Replies: 1
    Last Post: 05-10-2005, 10:33 AM
  4. heap question
    By mackol in forum C Programming
    Replies: 1
    Last Post: 11-30-2002, 05:03 AM
  5. stach and heap.
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 01-26-2002, 09:37 AM