Commit Graph

9196 Commits

Author SHA1 Message Date
gingerBill
cc2fa8f756 Fix thread/thread_unix.odin to use the new switch conventions 2019-12-22 12:11:54 +00:00
gingerBill
d1c9fd4e01 Implement #complete switch by default, replace with #partial switch #511 2019-12-22 12:03:48 +00:00
gingerBill
4593730632 Fix Trying to get a pointer to a struct field that does not have a size generates an LLVM error #509 2019-12-22 11:40:30 +00:00
gingerBill
f62a0891bd Fix Crash when compiling for loop with parens around array expression #506 2019-12-22 11:33:33 +00:00
gingerBill
4f2d4716ad Fix Internal error when accessing polymorphic struct parameters (also provide suggestions?) #513 2019-12-22 10:40:34 +00:00
gingerBill
022b793a7d Merge branch 'master' of https://github.com/odin-lang/Odin 2019-12-22 10:28:55 +00:00
gingerBill
7267004a55 Remove import "core:runtime" in integers.odin to make -vet happy 2019-12-22 10:28:48 +00:00
vassvik
786c9dfe07 Add the ability to toggle release mode externally when calling build.bat
The following cases builds Odin with optimizations:

    build.bat 1
    build.bat release

Any other options, or the lack thereof, will build without optimizations.
2019-12-22 11:19:42 +01:00
gingerBill
81b24594ce Add udivmod128.odin 2019-12-21 19:49:09 +00:00
gingerBill
995ba0df9a Fix using on array in struct 2019-12-21 14:42:08 +00:00
gingerBill
08392d885e Add strconv/integers.odin 2019-12-21 14:01:29 +00:00
gingerBill
d462dbb5be Deprecate using import 2019-12-21 12:11:16 +00:00
gingerBill
19c32ecb81 Add extra to -help output 2019-12-21 11:27:55 +00:00
gingerBill
494b1e7eaa Add -help which prints information about the compiler flags 2019-12-21 11:22:46 +00:00
gingerBill
c43d17bfec Merge pull request #505 from Tetralux/patch-2
Fix mem.Arena
2019-12-16 08:05:39 +00:00
Tetralux
c9723e2dc0 Fix mem.Arena 2019-12-15 21:36:40 +00:00
gingerBill
4ba579bc25 Also allow #no_bounds_check on an expression #499 2019-12-15 11:41:21 +00:00
gingerBill
58d4d424c6 Replace #vector[N]T with #simd[N]T to reduce confusion #498 2019-12-15 11:30:09 +00:00
gingerBill
89ccb5b99f Add assert into scratch_allocator_proc to prevent initialization cycles #504 2019-12-15 11:20:06 +00:00
gingerBill
7f5021c8e9 Disallow procedure calls with an associated deferred procedure to be used in logical binary expressions (short-circuiting) 2019-12-15 11:10:50 +00:00
gingerBill
8bec324779 Fix Duplicate integer switch case values incorrectly consider its absolute value #502
(Hashing proc was wrong for big ints)
2019-12-15 09:56:11 +00:00
gingerBill
e6f26b9931 Fix Unable to initialize a typeid field in a struct literal #501 2019-12-15 09:48:05 +00:00
gingerBill
b8c534eba9 Merge pull request #500 from SSStormy/fix-string_to_enum_value
Fix 'fmt.string_to_enum_value' not compiling
2019-12-15 09:38:37 +00:00
Justas Dabrila
95d3f43e15 Fix 'string_to_enum_value' not compiling 2019-12-14 01:08:47 +02:00
vassvik
2d97e1dee3 Fix NaN checks in core:math.classify
Currently the classify procedures checks for NaNs using the check `x != x`, which is always false for NaNs and therefore that case is never entered. Using `!(x == x)` will work on the other hand.
2019-12-12 19:12:12 +01:00
gingerBill
be2dfd42fd Merge pull request #493 from ThisDrunkDane/master
Fix #399 by removing unused parameter
2019-12-08 14:35:18 +00:00
Mikkel Hjortshoej
851118faf4 Fix #399 by removing unused parameter 2019-12-08 02:09:03 +01:00
gingerBill
53cd7a3d0c Fix transmute from uintptr to/from proc 2019-12-07 15:44:28 +00:00
gingerBill
f170648629 Fix issue with -thread-count flag with <= 0 count 2019-12-03 18:23:14 +00:00
gingerBill
42def957d5 Fix append_elem_string, again 2019-12-03 09:35:24 +00:00
gingerBill
6433a0d31e Fix append_elem_string 2019-12-03 09:16:11 +00:00
gingerBill
359e5d9e15 Fix append_elem_string 2019-12-03 09:07:15 +00:00
gingerBill
e229885b2b Remove addressing mode Addressing_Immutable 2019-12-01 19:11:00 +00:00
gingerBill
ee78374281 Fix typo 2019-12-01 18:57:43 +00:00
gingerBill
ebe152a155 Disable aligned heap allocations hack in os.heap_allocator_proc 2019-12-01 18:53:27 +00:00
gingerBill
46582a45bd Fix IR string interning type 2019-12-01 18:18:03 +00:00
gingerBill
6b5ea011e7 Add strings.ptr_from_string 2019-12-01 18:06:49 +00:00
gingerBill
9503440eb0 Add strings.unsafe_string_to_cstring 2019-12-01 17:45:07 +00:00
gingerBill
3fa4c5043a Fix crash caused by not checking for correct SOA kind on polymorphic parameters 2019-12-01 16:05:48 +00:00
gingerBill
9db81498d8 Make the string type elements "immutable", akin to char const * in C
Allows for extra security and optimization benefits
2019-12-01 14:10:59 +00:00
gingerBill
7fbe0a6f23 Fix nil comparisons for soa slices and dynamic arrays 2019-12-01 11:56:08 +00:00
gingerBill
3fd5c3cd85 Merge pull request #458 from Tetralux/linux-threads
Implement core:thread and core:sync on Unix using pthreads
2019-12-01 11:33:23 +00:00
Tetralux
99121d6ff2 Implement core:thread and core:sync on Unix using pthreads
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)`
2019-12-01 00:46:23 +00:00
gingerBill
0c0c83ee29 Disable find_visual_studio_and_windows_sdk_utf8 temporarily 2019-11-28 21:07:06 +00:00
gingerBill
b75d59d6e0 Make sort.merge_sort in place; Add sort.heap_sort 2019-11-27 16:06:07 +00:00
gingerBill
71c8a3456e Update package odin/parser for #soa and #vector 2019-11-27 15:23:54 +00:00
gingerBill
37e3e081c6 Update microsoft_craziness.h to work correctly with the rest of the codebase (and not use WIN32_LEAN_AND_MEAN) 2019-11-27 15:18:32 +00:00
gingerBill
5ea9fc3fb0 Merge pull request #478 from castano/auto-search-sdk
Allow running Odin compiler without using visual studio command prompt or setting up environgment variables.
2019-11-26 22:29:08 +00:00
Mikkel Hjortshøj
53f65224f6 Merge pull request #459 from zhibog/master
Base32 added for core:encoding
2019-11-26 19:45:52 +01:00
gingerBill
902d313c6a Fix issue with os.write on *nix with writing nothing 2019-11-24 10:08:08 +00:00