Memory Ownership Model

To ensure security, SRON has a unique memory ownership and accessibility model. The SRON's memory ownership and accessbility is handled during runtime in such a way that it does not affect the runtime performance of the bytecode.

All the memory allocated during the runtime is owned by one owner only and the rest of other variables just has the ability to read and manipulate the data but cannot change the owner of the memory.

If the owner is destructed, then the memory will be deallocated and if the other variables tries to access it, the program will exit with code -1.

Let's understand this by a simple program.

{
    name : Main

    List lst = [1 , 2 , 3]

    @ giving the access to the value at 0th index to 'val'
    Any val = at(lst, 0)

    println(val)

    @ clearing all the memory in the list
    clear(val)

    @ now the code will go halt
    println(val)
}

In the above code, we extracted the first element of the list and made 'val' to access that memory, after that we cleared the list. Now all the memory owned by 'lst' is destructed.

So, if you try to access that memory using 'val', the code will go halt.

Actually, all the values are owned by SRON's Garbage Collector but those values will not allow anyone not even Garbage Collector to access their underlying memory.


This is why SRON is so secure during the runtime along with the binary bytecode which cannot be decompiled at all.

Last updated