Golang - Stack & Heap

常常在社群里面看到从其他程序语言转来用Go会有的问题
这些是找到的资料跟总结
同步更新在github上
https://github.com/whitefloor/coding-interview-university-reading-notes-use-golang

Stack and Heap

一般的Stack & Heap

Golang的Stack & Heap

总结

  • 别用中文翻译去记,很难翻译而且很难记

Stack

  • 静态记忆体配置

      A call stack is a LIFO stack data structure that stores arguments, local variables, and other data tracked as a thread executes functions
    

将可预期的变数或是function等...的处理方法

Heap

  • 动态记忆体配置

将不可预期的变数或资料分配管理,且会被GC回收的处理方法

Golang的Stack & Heap

Go在使用上并没有提到Stack or Heap  
只会在GC(garbage-collected)内遵循一套严格的规则进行处理

If you need to know where your variables are allocated pass the "-m" gc flag to "go build" or "go run" (e.g., go run -gcflags -m app.go).

<<:  Day32 参加职训(机器学习与资料分析工程师培训班),tf.keras

>>:  第33天~

Day25 X ESR: Rendering On The Edge

基本上 CDN 是现在的 Web 应用不可或缺的技术,当对被 CDN 加速过的域名发出请求时,CD...

DAY 29 Django 简易入门教学(六)-建立资料库与模型(Model)

Django 资料库与模型(Model) 首先,先让我们新创立一个餐厅的 app : python ...

模型架构--1

GoogLeNet Google提出的GoogLeNet,层数比较多,运算的效率相当好,超参数数量比...

day18 : kafka服务应用 on K8S (下)

昨天介绍了kafka的机制,今天将会透过strimzi的方式配置kafka cluster,同样的会...

IT 铁人赛 k8s 入门30天 -- day4 k8s 架构:Control Plane Components

前言 昨日的延伸问题:如何跟 k8s 丛集互动? 主要就是透过今天要讲的 Control Plane...