<commit_before># buffer_list [![wercker status](https://app.wercker.com/status/af71821c3a51e35a170766fdab30e1b8/s "wercker status")](https://app.wercker.com/project/bykey/af71821c3a51e35a170766fdab30e1b8)
go Package  double linked list with (slice like) sequencial buffer




## example
```go
type Hoge struct {
  a int64
  b int64
  c *int64
}

buffer_list := buffer_list.New(&Hoge{}, 100)

hoge := buffer_list.Front().Value().(*Hoge)
hoge.a = 200
hoge.b = 500


new_e := blist.InsertLast() // allocate new element/value
hoge2 := new_e.Value().(*Hoge)
hoge2.a = 222
hoge2.b = 2222
hoge2.c = 1234
new_e.Commit() // protect from gc Free

for e:= blist.Front(); e != nil; e.Next() {
  fmt.Println("value", e.Value() )
}

```

## WARNING
this packages buffer is []byte so stored struct with pointer member is commonly free by GC.
buffer_list implement to protect struct's  pointer member. but nested struct cannot protect 
currently.( I will fix this problem, later)

if struct member is chan/slice/embedded pointer interface/Array/map/function , protected.


following case is protected/un-protected pattern.

Element.Value() is protected from GC Free in common case.
but following case is not protected


```gp
type IData struct {
        a int
        b int
}

type IValue struct {
        a *IData
}
type TValue struct {
        a  int
        iv IValue
        b  *IData
}

l := buffer_list.New(&TValue{}, 100)
e := l.InsertLast()
v := e.Value().(*TValue)
e.InitValue()

//v.iv is not protected. it may be freed 
v.iv = IValue{a: &IData{a: 10, b: 1}}

//v.b is OK
v.b = &IData{a: i * 10, b: i + 1}

e.Commit()

```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kazu/buffer_list<commit_msg>update doc<commit_after># buffer_list [![wercker status](https://app.wercker.com/status/af71821c3a51e35a170766fdab30e1b8/s "wercker status")](https://app.wercker.com/project/bykey/af71821c3a51e35a170766fdab30e1b8)
go Package  double linked list with (slice like) sequencial buffer



## Usage
```go
type Hoge struct {
  a int64
  b int64
  c *int64
}

buffer_list := buffer_list.New(&Hoge{}, 100)

hoge := buffer_list.Front().Value().(*Hoge)
hoge.a = 200
hoge.b = 500


new_e := blist.InsertLast() // allocate new element/value
hoge2 := new_e.Value().(*Hoge)
hoge2.a = 222
hoge2.b = 2222
hoge2.c = 1234
new_e.Commit() // protect from gc Free

for e:= blist.Front(); e != nil; e.Next() {
  fmt.Println("value", e.Value() )
}

```

## WARNING
this packages buffer is []byte so pointer member of nested struct is commonly freed by GC.
buffer_list implement to protect struct's  pointer member. but this problem is not fully fixed.


if struct member is chan/slice/embedded pointer interface/Array/map/function/struct , protected.


## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kazu/buffer_list
{'fraction_non_alphanumeric': 0.1280891054646711, 'fraction_numerical': 0.05186216498433693, 'mean_word_length': 3.814070351758794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3123261', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1010, 'n_words': 307}