I have a question for Go programmers among you. I can not find information about the details of the Go memory model. I will try to describe my problem:
If I declare and define a variable or array in C, I know that it exists somewhere in RAM in exactly the same position with one specific address, until I do something that will change this.
This does not apply to Python: Python does all the memory management for me, I cannot be sure that my data will always be in the same position. For instance. strings in practice are immutable, although the language suggests that this is not so. This makes safe programming with sensitive data virtually impossible (or at least very impractical).
My question is: how does Go work from this perspective. Is it more like C or like Python? Or is it completely different? Is it possible to process sensitive data as conveniently as in C?
Note: as mentioned in the “ Go Slices: Usage and Internal Options ” section :
The representation [4]intin memory is just four integer values laid out sequentially:
[4]int
Go arrays are values .; ( C). , , , .( , , , .)- , , : .
Go arrays are values .
; ( C). , , , .( , , , .)
- , , : .
" ", .
- . , ( ).s, make([]byte, 5), :
- . , ( ).
s, make([]byte, 5), :
s
make([]byte, 5)
, , " "
Go , new make., , .. , , , . new(T) T , *T.Go T.make: make(T, args) , new(T). , ( ) T (not *T)., , ., , ( ), , , , .
Go , new make., , .
new
make
. , , , . new(T) T , *T.Go T.
new(T)
T
*T
make: make(T, args) , new(T). , ( ) T (not *T)., , ., , ( ), , , , .
make(T, args)
. .
, Go, , C Python. Go , Python, - , C. Go , Python. , .
Go . goroutine , . - Go , Java. ( .)
, , , , Go, C. ( ) , - . , , , .
Go, , , C. Go , C, . ( , Heartbleed.) Go, , .
Source: https://habr.com/ru/post/1548192/More articles:Error executing a very simple HTTP server test using scala akka spray - scalaThe instance is not exported? - haskellAlert On button. Click and move the user to open a new tab - javascriptWhy is mutate () for a group taken forever? - rПривязка объекта к контексту не удается, поскольку оно уже существует - entity-frameworkPHP - поиск ключевых слов в строке и повышение качества и точности извлеченных ключевых слов - phpDetermine if users want to open the link in a new window or tab (Mac and Windows) - jqueryhow to create a tab with get property system? - javaReading in a text file in a given range of lines - pythonstrace: order and <... renewed> - linuxAll Articles