Documentation
¶
Overview ¶
Package elist_head is like a kernel's LIST_HEAD usage for storing slice/array
Package elist_head is like a kernel's LIST_HEAD usage for storing slice/array
Index ¶
- Constants
- Variables
- func Cas(target *uintptr, old, new uintptr) bool
- func CasIncPointer(t *uintptr, same uintptr, moved int) bool
- func ElementOf(head unsafe.Pointer, offset uintptr) unsafe.Pointer
- func Error(oe error, opts ...OptNewError) error
- func GetConcurrentMode() bool
- func IncPointer(t uintptr, moved int) uintptr
- func InitAfterSafety(retry int) func(*ListHead) error
- func InitAsEmpty(head *ListHead, tail *ListHead)
- func MarkListHead(target *uintptr, old uintptr) bool
- func NewEmptyList() initedListHead
- func OuterPtrs(sHead, sTail unsafe.Pointer, dHead unsafe.Pointer, size int, offset int) (outers []unsafe.Pointer)
- func RepaireSliceAfterCopy(sHead, sTail unsafe.Pointer, dHead unsafe.Pointer, size int, offset int) error
- func RollbacksharedModeTraverse(prev list_head.TravOpt)
- func SharedTrav(travs ...list_head.TravOpt) []list_head.TravOpt
- func StoreListHead(dst *unsafe.Pointer, src *ListHead)
- type BoolAndError
- type Head
- type List
- type ListHead
- func (head *ListHead) Delete(opts ...func(*ListHead) error) (result *ListHead, e error)
- func (head *ListHead) DirectNext() *ListHead
- func (head *ListHead) DirectPrev() *ListHead
- func (head *ListHead) Empty() bool
- func (head *ListHead) Init()
- func (head *ListHead) InsertBefore(new *ListHead, opts ...list_head.TravOpt) (*ListHead, error)
- func (head *ListHead) IsMarked() bool
- func (head *ListHead) IsSafety() (bool, error)
- func (head *ListHead) IsSingle() bool
- func (head *ListHead) MarkForDelete(opts ...list_head.TravOpt) (err error)
- func (head *ListHead) Next(opts ...list_head.TravOpt) (next *ListHead)
- func (head *ListHead) OffetNext() uintptr
- func (head *ListHead) OffetPrev() uintptr
- func (head *ListHead) P() string
- func (head *ListHead) Prev(opts ...list_head.TravOpt) (next *ListHead)
- func (head *ListHead) Ptr() unsafe.Pointer
- func (head *ListHead) ReplaceNext(nextHead *ListHead, nextTail *ListHead, next *ListHead) (err error)
- type ListHeadError
- type ListHeadWithError
- type OptNewError
- type SampleEntry
Constants ¶
View Source
const ( ErrTDeleteFirst = 1 << iota ErrTListNil ErrTEmpty ErrTMarked ErrTNextMarked ErrTNotAppend ErrTNotMarked ErrTCasConflictOnMark ErrTFirstMarked ErrTCasConflictOnAdd ErrTOverRetyry ErrTNoSafety ErrTNoContinous )
Variables ¶
View Source
var ( MODE_CONCURRENT bool = false PANIC_NEXT_IS_MARKED bool = false )
View Source
var ( ErrDeleteFirst error = NewError(ErrTDeleteFirst, errors.New("first element cannot delete")) ErrListNil error = NewError(ErrTListNil, errors.New("list is nil")) ErrEmpty error = NewError(ErrTEmpty, errors.New("list is empty")) ErrMarked error = NewError(ErrTMarked, errors.New("element is marked")) ErrNextMarked error = NewError(ErrTNextMarked, errors.New("next element is marked")) ErrNotAppend error = NewError(ErrTNotAppend, errors.New("element cannot be append")) ErrNotMarked error = NewError(ErrTNotMarked, errors.New("elenment cannot be marked")) ErrCasConflictOnMark error = NewError(ErrTCasConflictOnMark, errors.New("cas conflict(fail mark)")) ErrFirstMarked error = NewError(ErrTFirstMarked, errors.New("first element is marked")) ErrNoSafetyOnAdd error = NewError(ErrTNoSafety, errors.New("element is not safety to append")) ErrNoContinous error = NewError(ErrTNoContinous, errors.New("element is not continus")) )
Functions ¶
func Error ¶
func Error(oe error, opts ...OptNewError) error
func GetConcurrentMode ¶
func GetConcurrentMode() bool
func IncPointer ¶ added in v0.2.2
func InitAfterSafety ¶
func InitAsEmpty ¶
func MarkListHead ¶
func NewEmptyList ¶ added in v0.2.3
func NewEmptyList() initedListHead
NewEmptyList ... make Empty List . this has only head and tail terminater.
elist_head require head/tail terminater for list operation.
func RepaireSliceAfterCopy ¶
func StoreListHead ¶
Types ¶
type BoolAndError ¶
type BoolAndError struct {
// contains filtered or unexported fields
}
func MakeBoolAndError ¶
func MakeBoolAndError(t bool, e error) BoolAndError
type ListHead ¶
type ListHead struct {
// contains filtered or unexported fields
}
func (*ListHead) DirectNext ¶
func (*ListHead) DirectPrev ¶
func (*ListHead) InsertBefore ¶
func (*ListHead) MarkForDelete ¶
type ListHeadError ¶
func NewError ¶
func NewError(t uint16, err error, opts ...OptNewError) *ListHeadError
type ListHeadWithError ¶
type ListHeadWithError struct {
// contains filtered or unexported fields
}
func ListWithError ¶
func ListWithError(head *ListHead, err error) ListHeadWithError
func (ListHeadWithError) Error ¶
func (le ListHeadWithError) Error() string
func (ListHeadWithError) List ¶
func (le ListHeadWithError) List() *ListHead
type OptNewError ¶
type OptNewError func(e *ListHeadError)
func ErrorInfo ¶
func ErrorInfo(s string) OptNewError
type SampleEntry ¶ added in v0.2.3
var EmptySampleEntry *SampleEntry = nil
func SampleEntryFromListHead ¶ added in v0.2.3
func SampleEntryFromListHead(head *ListHead) *SampleEntry
func (*SampleEntry) FromListHead ¶ added in v0.2.3
func (s *SampleEntry) FromListHead(l *ListHead) List
func (*SampleEntry) InsertBefore ¶ added in v0.2.3
func (s *SampleEntry) InsertBefore(n *SampleEntry) (err error)
func (*SampleEntry) Next ¶ added in v0.2.3
func (s *SampleEntry) Next() *SampleEntry
func (*SampleEntry) Offset ¶ added in v0.2.3
func (s *SampleEntry) Offset() uintptr
func (*SampleEntry) Prev ¶ added in v0.2.3
func (s *SampleEntry) Prev() *SampleEntry
func (*SampleEntry) PtrListHead ¶ added in v0.2.3
func (s *SampleEntry) PtrListHead() *ListHead
Click to show internal directories.
Click to hide internal directories.