Commit Graph

178 Commits

Author SHA1 Message Date
gingerBill ca1f419dc2 Merge pull request #1819 from IanLilleyT/no_query_info
Allocator: tidying up Query_Info return values when not part of Query_Features
2022-06-12 17:15:08 +01:00
gingerBill d04f732e68 Add fmt:"s,0" to allow arrays and multi-pointers to be printed with NUL termination 2022-06-12 13:07:43 +01:00
gingerBill fb49841b1d Remove strings dependency from core:sys/windows 2022-06-02 13:02:16 +01:00
Ian Lilley dda2ed290a tidying up Query_Info return value when not in query features 2022-06-01 22:40:39 -04:00
Ian Lilley 66de1856e3 tighter allocation for arena allocator 2022-06-01 21:37:05 -04:00
gingerBill a1f15c2c69 Merge pull request #1807 from odin-lang/simd-dev
Generic #simd type and intrinsics
2022-05-31 11:52:24 +01:00
jason 10deb2e88b fix mmap call in virtual_linux.odin 2022-05-25 21:51:36 -04:00
gingerBill 63d6c08d90 Add raw_simd_data 2022-05-25 22:09:38 +01:00
gingerBill 7d2eedee73 Unify raw_data in core:mem with core:runtime 2022-05-23 11:47:12 +01:00
gingerBill 10f1d8c604 Fix typo 2022-05-21 13:38:38 +01:00
gingerBill 3049e07f72 Add mem.DEFAULT_PAGE_SIZE 2022-05-21 13:30:09 +01:00
gingerBill 0cc67ff5e3 Add a return value to mem.zero_item and mem.zero_slice which is the same as the input 2022-05-17 22:42:37 +01:00
gingerBill e10105a780 Correct logic for tracking allocator proc for freeing a nil pointer 2022-05-15 23:50:51 +01:00
gingerBill 5451c9672d Fix dynamic_pool_destroy 2022-05-15 23:48:11 +01:00
Jeroen van Rijn fe442d7c0c [mem] Fix Dynamic_Pool. 2022-05-05 10:45:15 +02:00
gingerBill a412d34574 Fix #1740 2022-04-26 11:35:34 +01:00
Jeroen van Rijn 7654afc2db Revert "Update mem.nil_allocator to match the same in runtime"
The change broke JSON unmarshaling.

This reverts commit 4484a3433d.
2022-04-19 15:01:54 +02:00
gingerBill ed4cb72b19 Merge pull request #1696 from Despacito696969/master
Fix for `slice_to_components` compilation error
2022-04-16 21:56:13 +01:00
hikari 698fcb7813 mem: replace size procedures with constants 2022-04-06 18:44:43 +03:00
Despacito696969 7f6c6945ae Fix for slice_to_components
Using `slice_to_components` wouldn't compile because `s.data` is type of `rawptr` and return type is `^T`
2022-04-05 20:17:47 +02:00
gingerBill 4484a3433d Update mem.nil_allocator to match the same in runtime 2022-03-31 15:03:56 +01:00
gingerBill 9f2d710c35 Change intrinsics.Atomic_Memory_Order fields to use Ada_Case rather than snake_case 2022-03-31 12:57:24 +01:00
gingerBill ba1930eb01 Update core to use new atomic intrinsics 2022-03-31 00:22:54 +01:00
gingerBill 4eb4ae6305 Replace sync with sync2 2022-03-30 17:42:44 +01:00
gingerBill 7e5342f41f Use contextless where possible 2022-03-01 15:52:14 +00:00
gingerBill 18607e53cb Correct alloc_from_memory_block 2022-03-01 15:38:04 +00:00
Jeroen van Rijn f971126183 [mem] Add missing \n to tracking allocator example. 2022-03-01 13:51:41 +01:00
Jeroen van Rijn a3d99765cc mem: Add doc.odin with Tracking_Allocator example. 2022-02-05 22:18:22 +01:00
Yawning Angel 61c581baeb core/sys/unix: Add syscalls_linux.odin
Linux is in the unfortunate situation where the system call number is
architecture specific.  This consolidates the system call number
definitions in a single location, adds some wrappers, and hopefully
fixes the existing non-portable invocations of the syscall intrinsic.
2021-11-17 14:00:00 +00:00
Yawning Angel 672fc9fc4d core/mem: Add zero_explicit
This call is intended to provide the ability to securely scrub memory
without compiler interference, in a similar manner to explicit_bzero,
memset_s, SecureZeroMemory.

The approach taken is a volatile memset followed by a seqentially
consistent memory fence, to prevent the call from being optimized away
by DSE, and from being reordered.  An identical approach is currently
being used by the zeroize Rust crate, and is effective in practice.

LLVM IR output:
```
; Function Attrs: nounwind
define internal i8* @mem.zero_explicit(i8* %0, i64 %1) #0 {
decls:
  call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 %1, i1 true)
  fence seq_cst
  ret i8* %0
}
```
2021-10-31 22:57:13 +00:00
gingerBill aaaddd03a6 Improve internal procedures 2021-10-25 01:28:06 +01:00
gingerBill 58e3f779f2 Remove nonsense from static_arena_init 2021-10-05 17:12:24 +01:00
gingerBill 455d64fbd4 Add error value to commit 2021-10-05 17:11:12 +01:00
gingerBill 16ca677c1f Correct mmap usage 2021-10-05 17:05:33 +01:00
gingerBill 1f1434b384 Add arena_util.odin 2021-10-05 16:42:42 +01:00
gingerBill f83370235f Add static_arena_bootstrap_new 2021-10-05 16:39:14 +01:00
gingerBill 4961aff51b Minor cleanup 2021-10-05 16:37:15 +01:00
gingerBill 0ed3143006 Merge branch 'master' of https://github.com/odin-lang/Odin 2021-10-05 16:28:25 +01:00
gingerBill bc2b8b597c Add virtual.Static_Arena 2021-10-05 16:28:14 +01:00
gingerBill ccc4c641c4 Clean up Memory_Block logic 2021-10-05 16:25:30 +01:00
Jeroen van Rijn 1931e3147d Remove assert from mem.ptr_to_bytes. Fixes #1206 2021-10-05 14:18:48 +02:00
gingerBill 9d9ec192f1 Rename to growing_arena.odin 2021-10-04 17:57:59 +01:00
gingerBill 586a000152 Add Protect_Flags for virtual.protect 2021-10-04 17:42:15 +01:00
gingerBill 728f143e33 Add virtual_linux.odin 2021-10-04 17:30:06 +01:00
gingerBill f2e78dcc0b Separate out the virtual memory allocation procedures
`reserve`, `commit`, `reserve_and_commit`, `decommit`, `release`, `protect`
2021-10-04 16:43:52 +01:00
gingerBill e05a305764 Minor clean up 2021-10-03 12:43:11 +01:00
gingerBill a437c95fed Remove mutex from Growing_Arena; Add Growing_Arena_Temp 2021-10-03 12:41:24 +01:00
gingerBill 8fe70978ff Add @(init) usage to core:mem/virtual 2021-10-03 12:40:51 +01:00
gingerBill 08ac2fd1b6 Rename virtual.Arena to virtual.Growing_Arena 2021-09-29 16:50:36 +01:00
gingerBill b2a36f204e Add a mutex to arena_free_all 2021-09-29 16:46:14 +01:00