updating documentation
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 19 Jan 2021 14:53:18 +0000 (08:53 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 19 Jan 2021 14:53:18 +0000 (08:53 -0600)
CHANGELOG
core/alloc/pool.onyx
docs/plan
docs/todo

index 5c831d9942243ea4a5d8b24fd4b2f4220a36deb3..2b6e5304acfbe8bea8de52f3b3fc0012411148a4 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,7 @@ Additions:
     it will work on many systems. ARM / PowerPC may not work correctly.
 * procedures can be polymorphic on an array size.
 * structures can be polymorphic on any compile-time known value.
+* procedures can be polymoprhic on any compile-time known value, including type expressions.
 * basics of operator overloading using `#operator +`.
 * multiple return values and multiple assignment / declarations.
 * #solidify directive for explicitly specifying type variables in polymorphic procs.
@@ -15,12 +16,9 @@ Additions:
 * '-VV' and '-VVV' for very verbose printing. Easier to nail down compiler issues because it stops
     printing in the entity where the problem is.
 * `io.Stream` API with `io.Reader` and `io.Writer`.
-* `map.empty`
-* `string.compare`
-* `array.copy`
 * ranges on switch cases, i.e. `case 4 .. 10`. Note, this is inclusive on the upper end,
     unlike most other uses of the range literal.
-* `map.update`
+* miscellaneous core library functions
 
 Removals:
 * struct literals can no longer specify values for members brought in through a `use`.
index 4abf6a5f5cc36c48703c1a8d5f3265e1dbd174a8..1f1e51accdd5fcd0c3a9b5b4a65d6738b339c78b 100644 (file)
@@ -1,5 +1,16 @@
 package core.alloc.pool
 
+// A pool allocator is an O(1) allocator that is capable of allocating and freeing.
+// It is able to do both in constant time because it maintains a linked list of all
+// the free elements in the pool. When an element is requested the first element of
+// linked list is returned and the list is updated. When an element is freed, it
+// becomes the first element. The catch with this strategy however, is that all of
+// the allocations must be of the same size. This would not be an allocator to use
+// when dealing with heterogenous data, but when doing homogenous data, such as
+// game entities, this allocator is great. It allows you to allocate and free as
+// many times as you want, without worrying about fragmentation or slow allocators.
+// Just make sure you don't allocate more than the pool can provide.
+
 PoolAllocator :: struct (Elem: type_expr) {
     buffer     : [] Elem;
     first_free : ^Elem;
index 1bb0d442be5594619e7a890356e87ec3b63487bf..1cd882884ecb6cda1c150b0137eeed90fe16d536 100644 (file)
--- a/docs/plan
+++ b/docs/plan
@@ -41,7 +41,7 @@ HOW:
             - struct member names
             - array length
 
-        [ ] baked parameters
+        [X] baked parameters
             - Compile time known parameters
             - Removes the argument from the list and replaces the function with the
                 baked function
index de52372ac63d0c2d3f8b3947a3c31f37bc0c7e24..5d0dc4795a18d21f209f8ed9e19746c8a77068d2 100644 (file)
--- a/docs/todo
+++ b/docs/todo
@@ -160,16 +160,16 @@ Usability:
     [ ] Make compiler work on MacOS
     [ ] Make Onyx easier to use from JS
     [ ] Add examples for the following language features:
-        - Slices
-        - Dynamic Arrays
-        - Structs and unions
-        - Enums
-        - switch statements
-        - for loops
-        - Maps
+        ✔ Slices
+        ✔ Dynamic Arrays
+        ✔ Structs and unions
+        ✔ Enums
+        ✔ switch statements
+        ✔ for loops
+        ✔ Maps
+        ✔ pipe operator
         - varargs
         - `use` keyword
-        ✔ pipe operator
         - Overloaded procedures
         - Polymorphic procedures
         - WASM directives (#export, #foreign)