near, far , huge pointers in linux.

This is a discussion on near, far , huge pointers in linux. within the C++ Programming forums, part of the General Programming Boards category; I have some doubt in use of near, far and huge pointers in Linux. My current machine is P4 on ...

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    22

    near, far , huge pointers in linux.

    I have some doubt in use of near, far and huge pointers in Linux.
    My current machine is P4 on intel915 chipset.

    I not completely aware of memory segment in intel8086 but do it applies to P4 also? If yes, how we manages so large memory?

    Do near, far and huge pointers carry any significance in Linux, since these were for dos ( as per my knowledge)? or there is one standard pointer in Linux , nohing like near,far ?
    Are we based on flat memory model in linux?

    regards
    quickNitin

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    They were used for greater memory access on now obsolete compilers. If you're using GCC, you don't need to bother with any of that.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jul 2006
    Posts
    22

    why segmention fault

    ya i have observed that.
    But my apetite has again risen.
    Then why segmentation fault appears.
    I am not clear about it.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,337
    segmentation faults appear when you access memory you don't own.

    This is typical of crappy code which came from DOS (which had no memory protection at all), and which also used all that near and far stuff.

    Post a short example which segfaults and we'll tell you why.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Jul 2006
    Posts
    22
    my code which is giving me seg fault is not short. Its a part of c++ hierarchichal structure.

    Will anybody guide me to somewebpage which will let me clear my concepts about such issues. I had gone through faq section.
    thanks salem for offering help.

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,337
    > Its a part of c++ hierarchichal structure.
    *looks at board*
    *moves to C++ board*
    Look very closely at all your constructors and destructors then.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    If you have a debugger you can figure out exactly where it segfaults, which would be very useful. eg,
    Code:
    $ gdb executable
    ...
    (gdb) run
    running...
    Segmentation fault (core dumped)
    
    (gdb) backtrace
    xxx in function()
    xxx in main()
    xxx in __crt0_startup
    (gdb) list
    code listing . . .
    (gdb) quit
    The program is running. Exit anyway? y
    $
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. linux, doubles, and unions
    By paraglidersd in forum Linux Programming
    Replies: 14
    Last Post: 11-19-2008, 10:41 AM
  2. installing linux for the first time
    By Micko in forum Tech Board
    Replies: 9
    Last Post: 12-06-2004, 04:15 AM
  3. Linux for Windows!
    By Strut in forum Linux Programming
    Replies: 2
    Last Post: 12-25-2002, 10:36 AM
  4. Linux? Windows Xp?
    By VooDoo in forum Linux Programming
    Replies: 15
    Last Post: 07-31-2002, 08:18 AM
  5. linux vs linux?
    By Dreamerv3 in forum Linux Programming
    Replies: 5
    Last Post: 01-22-2002, 08:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21