随笔分类 -  go

摘要:1、go func 编译如下程序,将断点打在go recvGen 和go tstPrint 处,分别单步调试进入newproc 函数查看fn地址 package main import "fmt" func tstPrint(x int, c chan int) { fmt.Printf("%d", 阅读全文
posted @ 2024-07-05 00:23 G1733 阅读(9) 评论(0) 推荐(0) 编辑
摘要:1、settls 从引导代码中可以看到,在执行settls前将m.tls放入了DI。 go/src/runtime/asm_amd64.s:159 TEXT runtime·rt0_go(SB),NOSPLIT|NOFRAME|TOPFRAME,$0 .... LEAQ runtime·m0+m_t 阅读全文
posted @ 2024-07-03 17:40 G1733 阅读(39) 评论(0) 推荐(0) 编辑
摘要:1、调度器初始化 调用点:src/runtime/asm_amd64.s:349 -> CALL runtime·schedinit(SB) runtime/proc.go : 526 func schedinit() { // raceinit must be the first call to 阅读全文
posted @ 2024-06-11 23:43 G1733 阅读(15) 评论(0) 推荐(0) 编辑
摘要:1、入口 1.1 准备go程序 package main func test() int { return 1 } func main() { go test() } 编译 go build main.go 1.2 使用readelf 查找入口 root@xxx:/data# readelf -h 阅读全文
posted @ 2024-06-07 01:40 G1733 阅读(31) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env bash GO_VERSION=${1:?"Please input a version, example: 1.16"} ARCH=amd64 if [ ! -d /usr/local/go ]; then curl -fSLO --compressed "http: 阅读全文
posted @ 2024-01-25 20:13 G1733 阅读(9) 评论(0) 推荐(0) 编辑
摘要:原文:https://blog.haohtml.com/archives/29385 Golang中的内存组件关系如下图所示 golang 内存分配组件 在学习golang 内存时,经常会涉及几个重要的数据结构,如果不熟悉它们的情况下,理解起来就显得格外的吃力,所以本篇主要对相关的几个内存组件做下数 阅读全文
posted @ 2022-05-11 23:19 G1733 阅读(1490) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示