V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  whitehack  ›  全部回复第 25 页 / 共 25 页
回复总数  496
1 ... 16  17  18  19  20  21  22  23  24  25  
2019-04-15 19:02:00 +08:00
回复了 VictorFrank1 创建的主题 Python Network 为空是什么操作!
把 debugger 那行删掉 就行了啊。。。
视频偷的 bilibili
https://bilibili.com-h-bilibili.com/20190415/8430_4408fc10/1000k/hls/1e74b114a00000002.ts
2019-04-02 10:43:54 +08:00
回复了 xeaglex 创建的主题 程序员 Go 语言同文件的多个 init 函数调用顺序?
2019-04-01 16:50:21 +08:00
回复了 boywhp 创建的主题 程序员 人生第一个过 1024 Star 的 项目 Free Connect 感谢各位大佬的支持
给你那个未签名驱动签个名吧,
提示:网上有个过期的驱动签名证书。可能通过改系统时间的方式签名。
@changwei 我猜层主没有了解过 windows 的 OpenProcess ReadProcessMemory. linux 是否有类似的不了解。
2019-04-01 16:13:40 +08:00
回复了 szzhiyang 创建的主题 程序员 你们的启蒙编程语言是?
@si
@devjoe
同样易语言。易语言之前简单接触过 html.
2019-03-29 20:51:48 +08:00
回复了 v2nika 创建的主题 程序员 写了个项目不敢重新启动了...
↑ 狗头
2019-03-29 20:50:48 +08:00
回复了 v2nika 创建的主题 程序员 写了个项目不敢重新启动了...
go test 吃屎去了?
2019-03-04 11:24:42 +08:00
回复了 V2FullStack 创建的主题 程序员 开发一个模块,被提了好几个问题单,心态崩了
写测试用例可以救你
这个应该是操作系统相关的吧
我猜一下, 子进程关闭的只是自己的复制描述符。关不了父进程的?
2019-03-04 11:16:56 +08:00
回复了 EEer 创建的主题 Go 编程语言 golang 函数传参 string 和*string 效率一样么
我觉得你应该从汇编的角度来分析。

teststr.go
```
package main

func test(str *string) int {

return len(*str)
}
func test2(str string) int {

return len(str)
}

func main() {
s :="a"

test2(s)
test(&s)


}


```

汇编

```
"".test STEXT nosplit size=53 args=0x10 locals=0x10
0x0000 00000 (teststr.go:3) TEXT "".test(SB), NOSPLIT, $16-16
0x0000 00000 (teststr.go:3) SUBQ $16, SP
0x0004 00004 (teststr.go:3) MOVQ BP, 8(SP)
0x0009 00009 (teststr.go:3) LEAQ 8(SP), BP
0x000e 00014 (teststr.go:3) FUNCDATA $0, gclocals·1a65e721a2ccc325b382662e7ffee780(SB)
0x000e 00014 (teststr.go:3) FUNCDATA $1, gclocals·69c1753bd5f81501d95132d08af04464(SB)
0x000e 00014 (teststr.go:3) FUNCDATA $3, gclocals·9fb7f0986f647f17cb53dda1484e0f7a(SB)
0x000e 00014 (teststr.go:3) PCDATA $2, $0
0x000e 00014 (teststr.go:3) PCDATA $0, $0
0x000e 00014 (teststr.go:3) MOVQ $0, "".~r1+32(SP)
0x0017 00023 (teststr.go:5) PCDATA $2, $1
0x0017 00023 (teststr.go:5) PCDATA $0, $1
0x0017 00023 (teststr.go:5) MOVQ "".str+24(SP), AX
0x001c 00028 (teststr.go:5) TESTB AL, (AX)
0x001e 00030 (teststr.go:5) PCDATA $2, $0
0x001e 00030 (teststr.go:5) MOVQ 8(AX), AX
0x0022 00034 (teststr.go:5) MOVQ AX, ""..autotmp_2(SP)
0x0026 00038 (teststr.go:5) MOVQ AX, "".~r1+32(SP)
0x002b 00043 (teststr.go:5) MOVQ 8(SP), BP
0x0030 00048 (teststr.go:5) ADDQ $16, SP
0x0034 00052 (teststr.go:5) RET

```


```
"".test2 STEXT nosplit size=47 args=0x18 locals=0x10
0x0000 00000 (teststr.go:7) TEXT "".test2(SB), NOSPLIT, $16-24
0x0000 00000 (teststr.go:7) SUBQ $16, SP
0x0004 00004 (teststr.go:7) MOVQ BP, 8(SP)
0x0009 00009 (teststr.go:7) LEAQ 8(SP), BP
0x000e 00014 (teststr.go:7) FUNCDATA $0, gclocals·1a65e721a2ccc325b382662e7ffee780(SB)
0x000e 00014 (teststr.go:7) FUNCDATA $1, gclocals·69c1753bd5f81501d95132d08af04464(SB)
0x000e 00014 (teststr.go:7) FUNCDATA $3, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
0x000e 00014 (teststr.go:7) PCDATA $2, $0
0x000e 00014 (teststr.go:7) PCDATA $0, $0
0x000e 00014 (teststr.go:7) MOVQ $0, "".~r1+40(SP)
0x0017 00023 (teststr.go:9) PCDATA $0, $1
0x0017 00023 (teststr.go:9) MOVQ "".str+32(SP), AX
0x001c 00028 (teststr.go:9) MOVQ AX, ""..autotmp_2(SP)
0x0020 00032 (teststr.go:9) MOVQ AX, "".~r1+40(SP)
0x0025 00037 (teststr.go:9) MOVQ 8(SP), BP
0x002a 00042 (teststr.go:9) ADDQ $16, SP
0x002e 00046 (teststr.go:9) RET

```

test 指针参数代码都比 不传指针的多。

指针的计算要多一个操作


下面是调用



```
// 定义字符串
0x0024 00036 (teststr.go:13) LEAQ go.string."a"(SB), AX
0x002b 00043 (teststr.go:13) MOVQ AX, "".s+24(SP)
0x0030 00048 (teststr.go:13) MOVQ $1, "".s+32(SP)


// 传值
0x0039 00057 (teststr.go:15) PCDATA $2, $0
// StringSlice 结构
0x0039 00057 (teststr.go:15) MOVQ AX, (SP)
0x003d 00061 (teststr.go:15) MOVQ $1, 8(SP)
0x0046 00070 (teststr.go:15) CALL "".test2(SB)


// 传指针
0x004b 00075 (teststr.go:16) LEAQ "".s+24(SP), AX
0x0050 00080 (teststr.go:16) PCDATA $2, $0
// Stringslice 指针
0x0050 00080 (teststr.go:16) MOVQ AX, (SP)
0x0054 00084 (teststr.go:16) CALL "".test(SB)
```
2019-02-20 17:04:29 +08:00
回复了 quadrapop 创建的主题 互联网 言说那位兄台呢,你的网站挂了
oschina.net 可以划一划
2019-02-20 17:01:49 +08:00
回复了 quadrapop 创建的主题 互联网 言说那位兄台呢,你的网站挂了
同问
1 ... 16  17  18  19  20  21  22  23  24  25  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2902 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 32ms · UTC 07:41 · PVG 15:41 · LAX 00:41 · JFK 03:41
Developed with CodeLauncher
♥ Do have faith in what you're doing.