mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-03 15:53:56 +00:00
feat(shm): 统一共享内存区域(§13.1) — 单 memfd 容纳 SuperBlock+StageContext+EvtRing
- unified.go: SuperBlock 布局 + SharedRef 类型 - NewHost(): 两段 memfd 合并为单一 memfd,fd 3 = 统一区域,fd 4 = eventfd - 子进程侧: testdata 插件从 SuperBlock 解析 ctxOff/evtOff - streaming 测试: EvtConsumer 协程在 host.Close 前 Stop+Wait 防 SIGSEGV
This commit is contained in:
@ -11,11 +11,10 @@ func (h *Host) procEnvForShm() []string { return nil }
|
||||
//
|
||||
// 顺序即 fd 编号(cmd.ExtraFiles[0] → 子进程 fd 3):
|
||||
//
|
||||
// fd 3 = StageContext 段
|
||||
// fd 4 = 事件环段
|
||||
// fd 5 = 事件通知(eventfd / pipe 读端)
|
||||
// fd 3 = 统一共享内存区域(SuperBlock + StageContext + EvtRing)
|
||||
// fd 4 = 事件通知(eventfd / pipe 读端)
|
||||
//
|
||||
// 插件侧模板 z_proc_shm_unix.go 的常量与此严格对应。
|
||||
func (h *Host) procExtraFilesForShm() []*os.File {
|
||||
return []*os.File{h.memfd, h.evtRingFd, h.evtfd}
|
||||
return []*os.File{h.memfd, h.evtfd}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user