B4R Question SOLVED I don't understand stack memory...

Discussion in 'B4R Questions' started by tigrot, May 12, 2018.

  1. tigrot

    tigrot Well-Known Member Licensed User

    Hi everybody:
    I have this sub beginning:
    Code:
    Dim ctx As Int=0
        
    Log(StackBufferUsage)
        
    Dim r(10As Record
        
    Dim raf As RandomAccessFile
        
    Dim buffer(18As Byte
        
    Dim totpezzi As ULong=0
        
    Dim totallarmi As ULong=0
        raf.Initialize(buffer,
    True)
        
    Log(StackBufferUsage)
    Record is a Type 18 bytes long
    I have a StackbufferUsage of 150 on both logs.
    I don't understand why. There should be a big difference
    Has anybody an explanation?
    Regards
    Mauro
     
  2. tigrot

    tigrot Well-Known Member Licensed User

    Found explanation. Local variables are allocated in stack not in stackbuffer. Better to study B4R implementation.
     
Loading...