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. General Programming
  3. C / C++ / MFC
  4. Default Stack Size

Default Stack Size

Scheduled Pinned Locked Moved C / C++ / MFC
sharepointdata-structures
7 Posts 2 Posters 1 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    hi I was getting storage overlays in my local variable when I noticed that the SP register was 0X4652E25F0 and my BP registers was 0X4C652E2A60 does that mean that my stack size is 144 bytes I have a table in the function itself that is 256 bytes to translate ASCII to EBCDIC beginthread stack size is 0

    L 1 Reply Last reply
    0
    • F ForNow

      hi I was getting storage overlays in my local variable when I noticed that the SP register was 0X4652E25F0 and my BP registers was 0X4C652E2A60 does that mean that my stack size is 144 bytes I have a table in the function itself that is 256 bytes to translate ASCII to EBCDIC beginthread stack size is 0

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Quote:

      In addition, the stack_size argument can be 0, in which case the operating system uses the same value as the stack that's specified for the main thread.

      Don't try to guess what the situation may be just by looking at registers. In most code BP is set as a base register from an offset of SP, but that does not imply any particular stack size.

      F 2 Replies Last reply
      0
      • L Lost User

        Quote:

        In addition, the stack_size argument can be 0, in which case the operating system uses the same value as the stack that's specified for the main thread.

        Don't try to guess what the situation may be just by looking at registers. In most code BP is set as a base register from an offset of SP, but that does not imply any particular stack size.

        F Offline
        F Offline
        ForNow
        wrote on last edited by
        #3

        I guess it could be set /F compiler option thanks

        L 1 Reply Last reply
        0
        • F ForNow

          I guess it could be set /F compiler option thanks

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          ForNow wrote:

          I guess it could be ...

          ... anything. Guessing is not generally a good strategy for fixing problems. You need to be sure what the problem is first. Maybe if you show the code where the problem occurs, and a few more details, we could make some useful suggestions.

          1 Reply Last reply
          0
          • L Lost User

            Quote:

            In addition, the stack_size argument can be 0, in which case the operating system uses the same value as the stack that's specified for the main thread.

            Don't try to guess what the situation may be just by looking at registers. In most code BP is set as a base register from an offset of SP, but that does not imply any particular stack size.

            F Offline
            F Offline
            ForNow
            wrote on last edited by
            #5

            if stepped thru the code in Assembler after the function prologue by subtracting BP - SP = stack size right ? I added code to a source file in Hercules cpu.c thing is its a makefile build which very confusing I was wondering if there isn't -F or /F flag for the stack size I guess it would default to some number my local variables and parameters would make the stack a little over 300 bytes, which is not too big I am trying to figure to determine where in the makefile is the compile for CPU.C Thanks

            L 1 Reply Last reply
            0
            • F ForNow

              if stepped thru the code in Assembler after the function prologue by subtracting BP - SP = stack size right ? I added code to a source file in Hercules cpu.c thing is its a makefile build which very confusing I was wondering if there isn't -F or /F flag for the stack size I guess it would default to some number my local variables and parameters would make the stack a little over 300 bytes, which is not too big I am trying to figure to determine where in the makefile is the compile for CPU.C Thanks

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I think we are talking at cross-purposes. What you are referring to is a function's frame size, which is a portion of the thread's stack. The frame will be created large enough for all the locally declared variables in that function, so you need to look at the source code to see why it is not large enough, or why it is being overwritten. The makefile may be using an inference rule for cpu.c, so you cannot always find a specific line which references it. But you should be able to find a reference to it somewhere in the Makefile (or any of its included subfiles). However, as I mentioned, you still need to diagnose the actual problem, and changing the stack size for the final application is unlikely to make any difference.

              F 1 Reply Last reply
              0
              • L Lost User

                I think we are talking at cross-purposes. What you are referring to is a function's frame size, which is a portion of the thread's stack. The frame will be created large enough for all the locally declared variables in that function, so you need to look at the source code to see why it is not large enough, or why it is being overwritten. The makefile may be using an inference rule for cpu.c, so you cannot always find a specific line which references it. But you should be able to find a reference to it somewhere in the Makefile (or any of its included subfiles). However, as I mentioned, you still need to diagnose the actual problem, and changing the stack size for the final application is unlikely to make any difference.

                F Offline
                F Offline
                ForNow
                wrote on last edited by
                #7

                I understand finally sorry I’m slow thanks so much

                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