Is there a clear memory of local variables?



  • Until that time, it was confident that, when the function was called at the engine team level (call), there was a transfer of registers/contained grid indicator values, the creation of a glass frame for the function in question, in the form of a change in the value of the local variables (as well as the return address and some other service small size). Work colleagues (aged seniors) said that local variables have lost productivity in the form of leprosy and memory releases. As far as I know, with a++, these things happen when new mallocHeapAlloc (for WinAPI) etc. There may indeed be a minimum glass frame for which the mechanism is simple.push ebp \ mov ebp, esp \ sub esp, N \ ... \ mov esp, ebp \ pop ebp \ ret \ ... \ add esp, Nand when this size is exceeded, is there an obscure remembrance in the pupil?



  • If they talk to you in words "Remembrances"either they're illiterate or they don't respect you. Why don't you just say "memory"?

    But it's really more interesting than they say. In some cases, memory will be shared, in some cases not. It depends on the type of change. For example:

    • Parameter described as int x - It's likely that the compiler will simply produce 4/8 Byte in the glass/registration, and if it's terribly optimizing, the losses may be zero in some cases.
    • Option two - variable as described MyObject* s - There will be 4/8 Byte in the glass/registration plus the necessary memory the site will be stored in memory (but only when the designer is clearly called).
    • Option three MyObject s Here, there will be sufficient memory in the glass to create the object and, perhaps, some amount in the brush, it depends on the class.

    The memory in the glass is released very quickly (replaced the glacier and beef, most importantly enough). Released also. But in both cases, there may be overhead costs for building/destructors.

    Maybe there is a minimum glass frame for which the mechanism is simple (push ebp mov ebp, esp sub esp, N ... mov esp, ebp pop ebp ret ... add esp, N), and when this size is exceeded, there is already an unmarked memory in the peach?

    I've never seen one of those with a+++ compiler, although theoretically possible.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2