aboutsummaryrefslogtreecommitdiff
path: root/core/mem/alloc.odin
Commit message (Collapse)AuthorAgeFilesLines
* Replace `core:*` to `base:*` where appropriategingerBill2024-01-281-1/+1
|
* oops, indentationColin Davidson2024-01-171-14/+14
|
* add resize_non_zeroed to query featuresColin Davidson2024-01-171-2/+22
|
* add non-zeroing append and resizeColin Davidson2023-12-041-0/+2
|
* Merge branch 'master' into separate-int-word-sizesgingerBill2023-06-061-33/+33
|\
| * Add missing `Allocator_Error` and `@(require_results)` to many proceduresgingerBill2023-05-221-33/+33
| |
* | Begin work on new pseudo-architecture: wasm64p32gingerBill2023-04-201-1/+1
|/
* Correct `map_reserve_dynamic` caused by an bizarre code generation buggingerBill2022-11-131-5/+3
|
* Add extra calls to `Tracking_Allocator`gingerBill2022-11-091-3/+11
|
* Make `map_free_dynamic` take the total size of the allocationgingerBill2022-11-081-2/+1
|
* Begin work on implementing the new `map` internalsgingerBill2022-11-071-11/+10
|
* Fix typogingerBill2022-09-221-1/+1
|
* Add `Allocator_Mode.Alloc_Non_Zerored`gingerBill2022-09-221-0/+4
|
* Clean-up and unification for the allocation proceduresgingerBill2022-08-081-36/+5
|
* Improve `resize` callgingerBill2022-08-081-54/+9
|
* Fix typogingerBill2022-05-211-1/+1
|
* Add `mem.DEFAULT_PAGE_SIZE`gingerBill2022-05-211-0/+5
|
* fix mem.new_cloneJeroen van Rijn2021-09-191-4/+5
|
* Revert "Merge pull request #1177 from Kelimion/new_clone"Jeroen van Rijn2021-09-191-5/+4
| | | | | This reverts commit efa513262e20d87242731764628440b69341bcbe, reversing changes made to daccfca11df1cb394e99b7f3ad369340147c1fe9.
* fix mem.new_cloneJeroen van Rijn2021-09-191-4/+5
|
* Remove unneeded semicolons from the core librarygingerBill2021-08-311-120/+120
|
* Unify `new`/`make` the internal logic between runtime and memgingerBill2021-08-231-26/+39
|
* Add `#any_int` directive to replace `auto_cast` uses on parameters.gingerBill2021-08-151-5/+5
|
* `Allocator_Error.Mode_Not_Implemented`; Minor improvement to `map` runtime ↵gingerBill2021-08-081-6/+24
| | | | procedures
* Fix typo in core:mem alloc() comment.Jeroen van Rijn2021-05-061-1/+1
|
* Update builtin procedures to support the new allocator features (without ↵gingerBill2021-04-191-3/+4
| | | | breaking other code)
* Improve the `Allocator` interface to support returning `Allocator_Error` to ↵gingerBill2021-04-191-13/+93
| | | | | | allow for safer calls Virtually all code (except for user-written custom allocators) should work as normal. Extra features will need to be added to make the current procedures support the `Allocator_Error` return value (akin to #optional_ok)
* Replace usage of `inline proc` with `#force_inline proc` in the core librarygingerBill2021-02-231-8/+8
|
* Fix `delete_map`gingerBill2021-02-021-1/+1
|
* Remove usage of `do` in core librarygingerBill2020-09-231-9/+23
|
* Add `mem.Allocator_Query_Info` and `mem.query_info`gingerBill2020-08-161-6/+20
|
* Add `mem.Allocator_Mode.Query_Features, `mem.Allocator_Mode_Set`, ↵gingerBill2020-08-161-0/+18
| | | | `mem.query_features`
* Add `mem.Tracking_Allocator`gingerBill2020-08-161-1/+1
|
* Fix `reflect.length`gingerBill2020-04-151-1/+3
|
* Change behaviour for zero-sized value types of array-related types; Fix make ↵gingerBill2020-04-121-2/+6
| | | | behaviour to always zero memory
* Fix make and reserveTetralux2020-01-031-1/+3
| | | | | | | | | | | | | | | - Set the allocator, even if memory allocation fails. Right now it doesn't, which means that if allocation fails, it'll use the context allocator instead. This memory will be leaked if the user doesn't understand that this happened. - Only set len and cap of the array returned from make iif the memory allocation succeeded. This means that reserve will return false if you do this: ``` a := make([dynamic]int, failing_allocator); if !reserve(&a, 5) do return; // or whatever indicates failure ```
* Fix behaviour for `make` to return `nil` when alloc returns `nil`gingerBill2020-01-031-0/+2
|
* Move definition of mem.Allocator and log.Logger to `package runtime`, to ↵gingerBill2019-12-311-6/+13
| | | | reduce import cycle magic
* Implement core:thread and core:sync on Unix using pthreadsTetralux2019-12-011-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also do some cleanup and refactoring of the thread, sync and time APIs. - remove 'semaphore_release' because 'post' and 'wait' is easier to understand - change 'semaphore_wait' to '*_wait_for' to match Condition - pthreads can be given a stack, but doing so requires the user to set up the guard pages manually. BE WARNED. The alignment requirements of the stack are also platform-dependant; it may need to be page size aligned on some systems. Unclear which systems, however. See 'os.get_page_size', and 'mem.make_aligned'. HOWEVER: I was unable to get custom stacks with guard pages working reliably, so while you can do it, the API does not support it. - add 'os.get_page_size', 'mem.make_aligned', and 'mem.new_aligned'. - removed thread return values because windows and linux are not consistent; windows returns 'i32' and pthreads return 'void*'; besides which, if you really wanted to communicate how the thread exited, you probably wouldn't do it with the thread's exit code. - fixed 'thread.is_done' on Windows; it didn't report true immediately after calling 'thread.join'. - moved time related stuff out of 'core:os' to 'core:time'. - add 'mem.align_backward' - fixed default allocator alignment The heap on Windows, and calloc on Linux, both have no facility to request alignment. It's a bit of hack, but the heap_allocator now overallocates; `size + alignment` bytes, and aligns things to at least 2. It does both of these things to ensure that there is at least two bytes before the payload, which it uses to store how much padding it needed to insert in order to fulfil the alignment requested. - make conditions more sane by matching the Windows behaviour. The fact that they were signalled now lingers until a thread tries to wait, causing them to just pass by uninterrupted, without sleeping or locking the underlying mutex, as it would otherwise need to do. This means that a thread no longer has to be waiting in order to be signalled, which avoids timing bugs that causes deadlocks that are hard to debug and fix. See the comment on the `sync.Condition.flag` field. - add thread priority: `thread.create(worker_proc, .High)`
* Reorganize `package mem`gingerBill2019-02-101-275/+0
|
* Change procedure group syntax from `proc[]` to `proc{}`; deprecate `proc[]` ↵gingerBill2018-12-021-4/+4
| | | | (raises warning currently)
* `-vet` flag to do basic vetting of codegingerBill2018-11-251-2/+2
|
* Fix `context` initializationgingerBill2018-10-201-2/+7
|
* Update runtime printing codegingerBill2018-10-111-0/+6
|
* context.allocator = a; Remove __ from runtime procs; improve division for ↵gingerBill2018-09-151-4/+1
| | | | complex numbers
* Fixed core library bugs after recent changes. (#257)Joshua Mark Manton2018-09-021-1/+1
| | | | | | * Fix `delete_map` calling `delete_dynamic_array` instead of `delete_slice for its hashes. * Removed print statements from `__dynamic_map_rehash`
* Add `$T: typeid/[]$E`; Deprecate `T: type/[]$E`gingerBill2018-09-021-6/+6
| | | | `type` as a keyword will soon be removed in favour of polymorphic names (identifiers) in procedures
* Change memory layout of `map` to be 3 words smallergingerBill2018-08-301-0/+3
|
* Fix `delete` for dynamic array and mapgingerBill2018-08-301-5/+5
|
* Add `Assertion_Failure_Proc` to `context`gingerBill2018-08-291-1/+19
|