{"id":18553897,"url":"https://github.com/libi/memoryview","last_synced_at":"2025-11-01T10:30:24.663Z","repository":{"id":94400391,"uuid":"281575491","full_name":"libi/memoryview","owner":"libi","description":"go内存视图查看器","archived":false,"fork":false,"pushed_at":"2020-07-24T06:55:57.000Z","size":3,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-12-26T08:42:54.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-22T04:36:09.000Z","updated_at":"2020-07-24T06:56:00.000Z","dependencies_parsed_at":"2023-06-25T20:29:44.692Z","dependency_job_id":null,"html_url":"https://github.com/libi/memoryview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fmemoryview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fmemoryview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fmemoryview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libi%2Fmemoryview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libi","download_url":"https://codeload.github.com/libi/memoryview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239278543,"owners_count":19612329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T21:18:47.475Z","updated_at":"2025-11-01T10:30:24.587Z","avatar_url":"https://github.com/libi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"GoMemoryView \n====\nGolang内存视图查看器,可以动态输出go语言各类型变量在内存中的数据状态及布局.\n\n### todo\n- 切片类型底层数组输出\n- Map类型输出 \n\n### 类型演示\n```go\n\ta := 10\n\tfmt.Println(MemView(\u0026a))\n    // [10 0 0 0 0 0 0 0]\n    // int 在64位系统下占用8个字节 \n\t\n\tb := int32(257)\n\tfmt.Println(MemView(\u0026b))\n    // [1 1 0 0] \n    // int32 占用4个字节，单字节上限256，逢256进1\n\t\n\tc := [3]int{1,2,3}\n\tfmt.Println(MemView(\u0026c))\n    // [1 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0] \n    // 长度为3 类型为int的数组 占用空间8*3字节 \n\n\td := c[2:3]\n\tfmt.Println(MemView(\u0026d))\n    // [16 224 12 0 192 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0] \n\t// 切片类型其实是一个包含 底层数组指针unsafe.Pointer，len，cap的结构体\n    // 在64位系统下 unsafe.Pointer ，int 占用8个字节\n    // 所以切片本身结构体占用24字节\n\n\te := \"abcd\"\n\tfmt.Println(MemView(\u0026e))\n    // [43 107 20 1 0 0 0 0 4 0 0 0 0 0 0 0] \n    // 字符串底层数据类型为类似切片的一个结构体 包含 unsafe.Pointer,len\n    // 所以底层结构体本身是16字节 前8字节位为指针位置 后8字节为长度\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibi%2Fmemoryview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibi%2Fmemoryview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibi%2Fmemoryview/lists"}