113 Commits

Author SHA1 Message Date
Jeroen van Rijn
7a9ea3ee6d Further overhaul of package line comments. 2025-10-09 23:05:29 +02:00
Jeroen van Rijn
8a35acd506 More package lines. 2025-10-09 20:11:06 +02:00
gingerBill
af189b45f3 Fix typo 2025-10-09 15:04:28 +01:00
gingerBill
940b0c54bc Add doc line to core:mem/virtual 2025-10-09 15:01:57 +01:00
gingerBill
a7af6055b0 Move memory mutex guard around for resize in virtual.Arena allocator 2025-09-27 10:27:08 +01:00
gingerBill
7642e0a0e0 Require @(init) and @(fini) to be proc "contextless" () 2025-08-08 12:10:01 +01:00
gingerBill
bb4bc316a4 for in string16; Support string16 across core 2025-08-02 12:20:35 +01:00
gingerBill
a2e7a62a26 Add virtual.new_clone 2025-07-30 23:14:53 +01:00
gingerBill
0dd0a3813b Fix very subtle bug in virtual.memory_block_alloc 2025-07-20 15:32:22 +01:00
Feoramund
efba9a1fb7 Disable usage of AddressSanitizer pending a per-allocator review
It has been discovered that AddressSanitizer does not keep a 1:1 mapping
of which bytes are poisoned and which are not. This can cause issues for
allocations less than 8 bytes and where addresses straddle 8-byte
boundaries.

See the following link for more information:

https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm#mapping
2025-06-15 15:06:28 -04:00
Lucas Perlind
83bc2d3c4a Add asan support for various allocators 2025-05-06 14:55:50 +10:00
gingerBill
539e9bd2e3 Merge pull request #4836 from laytan/fix-wrong-out-of-memory
fix wrong out of memory in edge cases, just try allocate from block for one source of truth
2025-03-20 17:20:26 +00:00
alektron
fd539b5e81 Fix: When resizing a virtual arena by commiting more of the already reserved memory, the total_used field of the arena was not updated; 2025-03-02 17:46:39 +01:00
Laytan Laats
cae3f13d9f mem/virtual: specify max protection on mmap call in NetBSD and FreeBSD 2025-02-18 18:33:19 +01:00
Laytan Laats
7df5be2131 fix wrong out of memory in edge cases, just try allocate from block for one source of truth 2025-02-12 19:09:21 +01:00
Barinzaya
98b3a9eacd Added support for growing in place to some arenas.
This affects `runtime.Arena` and `virtual.Arena`, but not currently
`mem.Arena`. These changes allow the last allocation that has been
made to be resized to a larger size by just extending their
allocation in-place, when there's sufficient room in the memory block to
do so.

Shrinking in place and re-using the rest of the allocation can be
supported using almost the same logic, but would require the memory to
be zeroed. Since this would add a additional cost that isn't currently
present, shrinking has not been changed.
2025-01-24 10:13:46 -05:00
alektron
a0c20023fc Fix: Issue with non-zeroed memory after arena_temp_and;
Fix: total_used field of growing Arena was not decremented correctly in arena_temp_end;
2025-01-15 17:59:30 +01:00
dmitriy.gorevoy
e82a0c8fc7 Fixed crash in arena_free_all() for bootstrapped growing arenas.
When trying to set arena.curr_block.used = 0 after mem.zero() caused a crash because if the arena is bootstrapped its memory will be zeroed out after mem.zero() thus making arena.cur_block point to zero.
2024-12-23 09:25:18 +01:00
Laytan Laats
20f4f378b2 sys/posix: add MAP_ANONYMOUS 2024-11-17 13:52:08 +01:00
Karl Zylinski
19f0127e55 Moved all packages in core, base, vendor, tests and examples to use new #+ file tag syntax. 2024-09-14 18:27:49 +02:00
Laytan Laats
5a22d49b72 mem/virtual: make sure the given size is used for subsequent blocks 2024-08-29 14:48:36 +02:00
Laytan Laats
fd2ad20cd4 mem/virtual: use sysconf for retrieving page size and actually use these init procs 2024-08-29 14:36:32 +02:00
Laytan Laats
7c9ca60ff0 mem/virtual: support the BSDs 2024-08-14 01:44:37 +02:00
Laytan Laats
efe68c2e24 posix: add package 2024-08-14 01:44:35 +02:00
gingerBill
93fabf8628 Replace err != 0 with err != nil where possible 2024-08-04 14:57:25 +01:00
Laytan Laats
0dfc660c71 allow core:mem/virtual import on more targets by expanding the other implementation 2024-07-11 01:55:59 +02:00
gingerBill
5413a8b744 Even more style fixes 2024-06-29 19:11:36 +01:00
Andreas T Jonsson
8ffe577a15 Added missing build tags in core 2024-04-25 09:43:54 +02:00
gingerBill
e01701ce0e Fix typo 2024-03-07 12:32:46 +00:00
gingerBill
f9b14500be Add default_commit_size to virtual.Arena 2024-03-07 12:30:34 +00:00
gingerBill
ffa3669d02 Add virtual.Arena utilities: new, new_aligned, make 2024-03-06 15:23:56 +00:00
Laytan
9b4cd0743c mem/virtual: fix arena_static_reset_to inverted logic 2024-02-06 20:24:38 +01:00
gingerBill
9a16bc5fc5 Remove core:os dependency for base:runtime 2024-01-28 22:40:46 +00:00
gingerBill
3e7e779abf Replace core:* to base:* where appropriate 2024-01-28 22:18:51 +00:00
gingerBill
799f4379d8 Keep vet happy 2024-01-17 22:51:49 +00:00
gingerBill
bd51b21386 Fix typo 2024-01-17 22:47:23 +00:00
gingerBill
276284cbec Fix typo 2024-01-17 22:44:28 +00:00
gingerBill
a8021f03a6 Rename to Map_File_* 2024-01-17 22:43:35 +00:00
gingerBill
c35d5d4c42 Merge branch 'master' of https://github.com/odin-lang/Odin 2024-01-17 22:41:28 +00:00
gingerBill
248a0bfa5f Add virtual.map_file 2024-01-17 22:41:22 +00:00
Colin Davidson
d0bb1fb844 bring log allocator up to date 2024-01-17 13:11:10 -08:00
gingerBill
90ac400ec5 stdcall -> system 2024-01-17 17:25:23 +00:00
xb-bx
c6c710465a fix 2024-01-08 19:54:39 +02:00
Laytan
baa5ea9258 fix not passing arg everywhere 2023-12-18 16:41:55 +01:00
Laytan
9a490e4e0d fix big alignment 2023-12-18 16:38:51 +01:00
Laytan Laats
252de70b0f fix same problem in virtual arena 2023-12-18 15:41:36 +01:00
Karl Zylinski
65333181fc virtual arena: Actually use DEFAULT_ARENA_STATIC_RESERVE_SIZE as default value on arena_init_static 2023-12-04 21:15:46 +01:00
Colin Davidson
bfbeb23f54 add resize non zeroed in more places 2023-12-04 03:09:13 -08:00
flysand7
4d65b1ab9c Implement new sys/unix package 2023-10-27 10:51:21 +11:00
gingerBill
27931249ce Scale by 3/2 rather than 5/4 2023-08-15 15:45:12 +01:00