Skip to content

storozhukBM/allocator

Repository files navigation

allocator. WIP. This library is under construction.

Build Go Report Card GoDoc

Primitive arena allocator

List build targets

go run make -h

Verify

go run make verify

Or you can prebuild make tool and use it like that

go run make itself
./make verify

Roadmap

  1. arena map on top of linear hashing alg
  2. instrumented arena
  3. create additional methods for allocation within limits that can accept to sizes (minSize, preferableSize)
  4. close arena function
  5. arena leak detector
  6. to ref pointers leak detector
  7. thread safe arena registry:
    1. with whole registry allocation limit
    2. by type arena pools
    3. metrics

Done:

  1. Raw arena implementation
  2. General arena wrapper with basic metrics
  3. Support fetch current allocation offset
  4. Preallocate arena buffer
  5. Arena options
  6. Wrap arenas into each other
  7. Set allocation limits
  8. Clear whole arena
  9. Byte slice allocation options
    1. Capacity management
    2. Append function
    3. Separate hiding header that can be resolved to []byte
    4. Full slice copy to general heap option
    5. String cast option
    6. Copy to heap with to string cast
    7. Arena string allocation option from passed []byte
    8. Optimization of append to consecutive byte slices where we try to fit allocation in currently available buffer
  10. Code generation - take into account the observability of specified structure
  11. Option to clean a underlying arena during clear in Generic allocator
  12. Make sure that Append works on top of "empty" slices
  13. Tests with '-d=checkptr'
  14. Make arena.Buffer.WriteString throw panic on allocation error to bo compatible with bytes.Buffer
  15. Documentation for the generated code
  16. Add sub-slicing to the generated code and arena.Bytes
  17. Get rid of reflect in library code by replacing reflect.SliceHeader with private type

About

Primitive arena allocator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages