Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Pascal calling convention !!

Pascal calling convention !!

Scheduled Pinned Locked Moved The Lounge
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ravish
    wrote on last edited by
    #1

    How does using the Pascal calling convention reduce memory requirement ? All the Books state this, but not how - except that the parameters are pushed from left to right to the stack.

    K S 2 Replies Last reply
    0
    • R Ravish

      How does using the Pascal calling convention reduce memory requirement ? All the Books state this, but not how - except that the parameters are pushed from left to right to the stack.

      K Offline
      K Offline
      Kastellanos Nikos
      wrote on last edited by
      #2

      I am not sure but i think that it has to do with the way that functions release heap memory. - - - - - - - - - - - - - - - - - - Memory leaks is the price we pay \0 01234567890123456789012345678901234

      1 Reply Last reply
      0
      • R Ravish

        How does using the Pascal calling convention reduce memory requirement ? All the Books state this, but not how - except that the parameters are pushed from left to right to the stack.

        S Offline
        S Offline
        Steen Krogsgaard
        wrote on last edited by
        #3

        AFAIK it's because in Pascal cc it's the callee that cleans up the stack while in C-type cc it's the caller. So the clean-up code is duplicated for each call in C-type cc while it's present only once (at the end of the function) in Pascal cc. This is also why Pascal cc cannot handle a variable number of arguments (how's the callee supposed to know?). Cheers Steen. "To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"

        S 1 Reply Last reply
        0
        • S Steen Krogsgaard

          AFAIK it's because in Pascal cc it's the callee that cleans up the stack while in C-type cc it's the caller. So the clean-up code is duplicated for each call in C-type cc while it's present only once (at the end of the function) in Pascal cc. This is also why Pascal cc cannot handle a variable number of arguments (how's the callee supposed to know?). Cheers Steen. "To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"

          S Offline
          S Offline
          Stephen Kellett
          wrote on last edited by
          #4

          Correct. Stephen Kellett -- C++/Java/Win NT/Unix variants Memory leaks/corruptions/performance/system problems. UK based. Problems with RSI/WRULD? Contact me for advice.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups