Commit Graph

102 Commits

Author SHA1 Message Date
gingerBill
7bbc9a4634 Add #any_int directive to replace auto_cast uses on parameters. 2021-08-15 12:56:59 +01:00
gingerBill
4d00c2b800 Allocator_Error.Mode_Not_Implemented; Minor improvement to map runtime procedures 2021-08-08 14:29:45 +01:00
gingerBill
3e7aabe6d8 Change uses for parapoly records to use $ always 2021-06-14 11:43:35 +01:00
Jeroen van Rijn
03862d1f48 Mark mem.slice_ptr_to_bytes as deprecated.
Use byte_slice instead.

We can't make it an alias *and* mark it as deprecated, regrettably:

```odin
byte_slice :: #force_inline proc "contextless" (data: rawptr, len: int) -> []byte {
    return transmute([]u8)Raw_Slice{data=data, len=max(len, 0)};
}
@(deprecated="use byte_slice")
slice_ptr_to_bytes :: byte_slice;

"mem.odin(145:1) Constant alias declarations cannot have attributes"
```
2021-05-06 13:23:17 +02:00
Jeroen van Rijn
4f51d74fc2 Fix typo in core:mem alloc() comment. 2021-05-06 11:25:41 +02:00
gingerBill
e9b1d4f633 Fix #906 2021-04-20 10:34:41 +01:00
gingerBill
c3b3194a00 Update builtin procedures to support the new allocator features (without breaking other code) 2021-04-19 22:44:20 +01:00
gingerBill
f98c4d6837 Improve the Allocator interface to support returning Allocator_Error to 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)
2021-04-19 12:31:31 +01:00
gingerBill
359ae29d98 Minor fixes 2021-03-18 13:25:41 +00:00
gingerBill
b727b6438b Minimize unneeded casts 2021-03-03 14:31:17 +00:00
gingerBill
aa93305015 Replace usage of inline proc with #force_inline proc in the core library 2021-02-23 16:14:47 +00:00
gingerBill
415379e1cf Fix delete_map 2021-02-02 16:30:34 +00:00
Luka Aleksić
00ebc877a1 Tracking allocator now tracks bad free calls 2021-01-21 00:19:56 +01:00
gingerBill
54fbdabc38 Add experimental -insert-semicolon functionality to tokenizer and parser 2020-11-01 15:10:06 +00:00
gingerBill
6eeb12a986 Improve default temp_allocator; make nil loggers do nothing; improve mem.Scratch_Allocator behaviour 2020-10-02 16:06:55 +01:00
gingerBill
a65553293f Add mem.Small_Allocator 2020-10-02 11:09:36 +01:00
gingerBill
519dcc2b76 Add os.read_at and for Windows; fix mem.clone_slice; fix current directory locking code 2020-09-29 11:11:28 +01:00
gingerBill
fc4fdd588e Remove usage of do in core library 2020-09-23 17:17:14 +01:00
gingerBill
4930a9c1a4 Add mem.clone_slice 2020-09-15 11:51:38 +01:00
gingerBill
e7f54d25d6 Add mem.Allocator_Query_Info and mem.query_info 2020-08-16 23:05:33 +01:00
gingerBill
033b46def8 Add mem.Allocator_Mode.Query_Features, mem.Allocator_Mode_Set, mem.query_features` 2020-08-16 22:07:40 +01:00
gingerBill
1f571f48e5 Add mem.Tracking_Allocator 2020-08-16 21:29:14 +01:00
gingerBill
3385fcecb0 Fix typo 2020-08-04 14:31:14 +01:00
gingerBill
d1d5f61230 Add intrinsics.alloca 2020-08-02 14:59:39 +01:00
gingerBill
92363da58e Add -show-system-calls; Update runtime for windows_386; Fix some minor bugs 2020-06-30 10:09:58 +01:00
gingerBill
8478b887a5 Add mem.check_zero and mem.check_zero_ptr 2020-06-29 16:17:40 +01:00
gingerBill
86448ee044 Add raw_data to replace cases in which &x[0] was used 2020-06-29 15:58:24 +01:00
gingerBill
be76c860a5 mem.simple_equal 2020-06-12 14:52:31 +01:00
gingerBill
474d79dcf1 Add mem.simple_compare_values 2020-06-10 16:37:22 +01:00
gingerBill
59a0bbb385 Improve termination rules checking for missing return; Make diverging procedure -> ! be terminators 2020-06-06 15:16:24 +01:00
gingerBill
8b066b2456 Fix runtime.memset issue 2020-05-14 17:56:24 +01:00
gingerBill
e0a242e9a1 Enforce explicit context definition for procedure calls 2020-05-14 13:44:28 +01:00
gingerBill
117ade0700 Fix errors in package win32 2020-04-30 17:48:35 +01:00
gingerBill
97f7a558fa #optional_ok tag for procedures 2020-04-19 21:45:04 +01:00
gingerBill
dbaf8568d6 Fix reflect.length 2020-04-15 18:56:19 +01:00
gingerBill
9e698b720f Change behaviour for zero-sized value types of array-related types; Fix make behaviour to always zero memory 2020-04-12 10:41:44 +01:00
gingerBill
baf5b9edc3 Add runtime.bswap_* required for -llvm-api 2020-04-11 19:26:16 +01:00
gingerBill
c6c6c56ba9 Fix mem.set for LLVM C API 2020-03-08 18:44:45 +00:00
gingerBill
c74d8405ec Merge branch 'master' into llvm-integration 2020-03-08 10:13:19 +00:00
Tetralux
0190f90979 Fix mem.align_backward when pointer is already aligned 2020-02-28 12:22:30 +00:00
gingerBill
e197af766d Merge branch 'master' into llvm-integration 2020-02-23 10:39:57 +00:00
gingerBill
2180f4a475 Basic work on obj generation 2020-02-23 10:04:25 +00:00
Tetralux
1f0c1943da Fix #552.
- Fix comparisons involving one or more empty string.
- Fix comparisons against two strings of different lengths.
2020-02-12 11:25:12 +00:00
Tetralux
b32ef9e47b Fix make and reserve
- 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
  ```
2020-01-03 10:40:45 +00:00
gingerBill
b8324b0776 Fix behaviour for make to return nil when alloc returns nil 2020-01-03 10:17:30 +00:00
gingerBill
13107628f8 Make mem.set use llvm.memset.p0i8.iXX 2019-12-31 14:09:51 +00:00
gingerBill
ab52f8d795 Move definition of mem.Allocator and log.Logger to package runtime, to reduce import cycle magic 2019-12-31 12:15:19 +00:00
gingerBill
a8a4dc1eb1 Make default context.temp_allocator thread safe when using package thread 2019-12-29 18:08:48 +00:00
Tetralux
c9723e2dc0 Fix mem.Arena 2019-12-15 21:36:40 +00:00
gingerBill
89ccb5b99f Add assert into scratch_allocator_proc to prevent initialization cycles #504 2019-12-15 11:20:06 +00:00