Lines Matching refs:va
126 func (va *vmaAlloc) noteAlloc(page, size uint64) {
128 if _, ok := va.m[i]; ok {
131 va.m[i] = struct{}{}
132 va.used = append(va.used, i)
136 func (va *vmaAlloc) alloc(r *randGen, size uint64) uint64 {
137 if size > va.numPages {
138 panic(fmt.Sprintf("vmaAlloc: bad size=%v numPages=%v", size, va.numPages))
141 if len(va.used) == 0 || r.oneOf(5) {
144 page = va.numPages - page - size
147 page = va.used[r.rand(len(va.used))]
155 if page+size > va.numPages {
156 page = va.numPages - size
159 if page >= va.numPages || size > va.numPages || page+size > va.numPages {
160 panic(fmt.Sprintf("vmaAlloc: bad page=%v size=%v numPages=%v", page, size, va.numPages))
162 va.noteAlloc(page, size)