@@ -319,18 +319,18 @@ type gobuf struct {
319
319
bp uintptr // for framepointer-enabled architectures
320
320
}
321
321
322
- // maybeLivePtr is a special pointer that is conditionally trackable
322
+ // maybeTraceablePtr is a special pointer that is conditionally trackable
323
323
// by the GC. It consists of an address as a uintptr (vu) and a pointer
324
324
// to a data element (vp).
325
325
//
326
- // maybeLivePtr values can be in one of three states:
326
+ // maybeTraceablePtr values can be in one of three states:
327
327
// 1. Unset: vu == 0 && vp == nil
328
328
// 2. Untracked: vu != 0 && vp == nil
329
329
// 3. Tracked: vu != 0 && vp != nil
330
330
//
331
331
// Do not set fields manually. Use methods instead.
332
332
// Extend this type with additional methods if needed.
333
- type maybeLivePtr struct {
333
+ type maybeTraceablePtr struct {
334
334
vp unsafe.Pointer // For liveness only.
335
335
vu uintptr // Source of truth.
336
336
}
@@ -339,56 +339,56 @@ type maybeLivePtr struct {
339
339
// This is used to hide the pointer from the GC.
340
340
//
341
341
//go:nosplit
342
- func (p * maybeLivePtr ) untrack () {
342
+ func (p * maybeTraceablePtr ) setUnraceable () {
343
343
p .vp = nil
344
344
}
345
345
346
- // track resets the pointer to the stored address.
346
+ // setTraceable resets the pointer to the stored address.
347
347
// This is used to make the pointer visible to the GC.
348
348
//
349
349
//go:nosplit
350
- func (p * maybeLivePtr ) track () {
350
+ func (p * maybeTraceablePtr ) setTraceable () {
351
351
p .vp = unsafe .Pointer (p .vu )
352
352
}
353
353
354
354
// set sets the pointer to the data element and updates the address.
355
355
//
356
356
//go:nosplit
357
- func (p * maybeLivePtr ) set (v unsafe.Pointer ) {
357
+ func (p * maybeTraceablePtr ) set (v unsafe.Pointer ) {
358
358
p .vp = v
359
359
p .vu = uintptr (v )
360
360
}
361
361
362
362
// get retrieves the pointer to the data element.
363
363
//
364
364
//go:nosplit
365
- func (p * maybeLivePtr ) get () unsafe.Pointer {
365
+ func (p * maybeTraceablePtr ) get () unsafe.Pointer {
366
366
return unsafe .Pointer (p .vu )
367
367
}
368
368
369
369
// uintptr returns the uintptr address of the pointer.
370
370
//
371
371
//go:nosplit
372
- func (p * maybeLivePtr ) uintptr () uintptr {
372
+ func (p * maybeTraceablePtr ) uintptr () uintptr {
373
373
return p .vu
374
374
}
375
375
376
- // maybeLiveChan extends conditionally trackable pointers (maybeLivePtr )
376
+ // maybeTraceableChan extends conditionally trackable pointers (maybeTraceablePtr )
377
377
// to track hchan pointers.
378
378
//
379
379
// Do not set fields manually. Use methods instead.
380
- type maybeLiveChan struct {
381
- maybeLivePtr
380
+ type maybeTraceableChan struct {
381
+ maybeTraceablePtr
382
382
}
383
383
384
384
//go:nosplit
385
- func (p * maybeLiveChan ) set (c * hchan ) {
386
- p .maybeLivePtr .set (unsafe .Pointer (c ))
385
+ func (p * maybeTraceableChan ) set (c * hchan ) {
386
+ p .maybeTraceablePtr .set (unsafe .Pointer (c ))
387
387
}
388
388
389
389
//go:nosplit
390
- func (p * maybeLiveChan ) get () * hchan {
391
- return (* hchan )(p .maybeLivePtr .get ())
390
+ func (p * maybeTraceableChan ) get () * hchan {
391
+ return (* hchan )(p .maybeTraceablePtr .get ())
392
392
}
393
393
394
394
// sudog (pseudo-g) represents a g in a wait list, such as for sending/receiving
@@ -411,7 +411,7 @@ type sudog struct {
411
411
next * sudog
412
412
prev * sudog
413
413
414
- elem maybeLivePtr // data element (may point to stack)
414
+ elem maybeTraceablePtr // data element (may point to stack)
415
415
416
416
// The following fields are never accessed concurrently.
417
417
// For channels, waitlink is only accessed by g.
@@ -439,10 +439,10 @@ type sudog struct {
439
439
// in the second entry in the list.)
440
440
waiters uint16
441
441
442
- parent * sudog // semaRoot binary tree
443
- waitlink * sudog // g.waiting list or semaRoot
444
- waittail * sudog // semaRoot
445
- c maybeLiveChan // channel
442
+ parent * sudog // semaRoot binary tree
443
+ waitlink * sudog // g.waiting list or semaRoot
444
+ waittail * sudog // semaRoot
445
+ c maybeTraceableChan // channel
446
446
}
447
447
448
448
type libcall struct {
0 commit comments