Commit Graph

62 Commits

Author SHA1 Message Date
af8a7b5be0 [*] Merge remote-tracking branch 'github/master'
[*] Updated synch primitives
2023-03-29 12:07:38 +01:00
Chris Robinson
a461d5f0a3 Don't try to use std::pointer_traits::to_address 2023-01-30 19:10:43 -08:00
Chris Robinson
c8ad6422d6 Try to fix has_to_address 2023-01-30 18:54:58 -08:00
Chris Robinson
a719f0f963 Don't pass an unnecessarily large alignment to allocator::rebind 2023-01-30 00:33:44 -08:00
Chris Robinson
c79b633a1c Use std::pointer_traits::to_address when available 2023-01-29 21:27:53 -08:00
Chris Robinson
c40e1bc1ce Better handle span sources from iterators 2022-12-14 17:39:47 -08:00
Chris Robinson
a5729d1ff6 Check the container type given to DEF_NEWDEL and DEF_FAM_NEWDEL
There's apparently no way to get the containing class/struct type from a static
member function, and operator new/delete are implicitly static member functions
so the macros to define them need to be told the type to allocate for. This
ensures the type specified matches the containing type.
2022-05-16 23:56:07 -07:00
Chris Robinson
51796ccbed Move assume_aligned to opthelpers.h and define force_inline 2022-03-30 01:33:32 -07:00
Chris Robinson
b9ff9fa6d9 Avoid a variable to subscript an array in offsetof 2022-03-26 17:25:57 -07:00
Chris Robinson
1ee34556a6 Try to improve assume_aligned for other compilers 2022-03-25 00:13:06 -07:00
Chris Robinson
88d5c47e37 Simplify a couple offsetof statements 2022-03-24 16:12:23 -07:00
Chris Robinson
837652624b Remove an unnecessary noexcept 2021-10-23 08:14:30 -07:00
Chris Robinson
ed3e40c22d Add more noexcept 2021-10-14 12:44:05 -07:00
Chris Robinson
8305973e7a Properly noexcept the destroy methods 2021-10-14 12:44:05 -07:00
Chris Robinson
e3b8f8fe27 Make a construct_at method amd use it 2021-10-08 11:05:36 -07:00
Chris Robinson
8da4eaff29 Add the gnu::malloc attribute to al_malloc and al_calloc
This helps the compiler know the returned pointer won't alias another pointer
or existing object, since it's a fresh allocation, and is unlikely to return
nullptr.
2021-10-07 13:37:47 -07:00
acdc8a2e14 Merge remote-tracking branch 'github/master'
# Conflicts:
#	al/filter.cpp
#	alc/alcmain.h
#	alc/alcontext.h
#	alc/backends/base.h
#	alc/compat.h
#	alc/effects/base.h
#	common/almalloc.cpp
#	core/helpers.cpp
#	core/hrtf.cpp
#	core/logging.h
2021-06-05 19:35:40 +01:00
Reece
9ddf5419f0 [+] Aurora Engine wrappers
[*] Unfuck legacy build pipeline dependency, now compiles under our buildchain
[-] Partially strip legacy logger
[-] Removed TRACE that doesn't compile with our logger
[*] Use Aurora Runtime for IO when possible
[TODO] Wrap Aurora Runtime streams
2021-06-05 18:58:41 +01:00
Chris Robinson
3142fb30ea Remove some unnecessary function attributes
The alloc_size was wrong anyway since the function parameter takes the number
of objects to be allocated and the attribute declares which is the number of
bytes. The assume_aligned is unnecessary since the function is inlined and
al_malloc/al_calloc already have appropriate attributes for the compiler to
see.
2021-01-23 03:27:18 -08:00
Chris Robinson
7833cfa8de Make FlexArray trivially destructible when possible 2020-12-27 04:29:54 -08:00
Chris Robinson
34b29a48a4 Ensure enough space is allocated for structs with a FlexArray 2020-08-15 23:53:43 -07:00
Chris Robinson
23259b48dd Avoid a zero-length array for the FlexArray definition
Newer GCCs are warning about FlexArray being used at the end of another struct.
Though not the most ideal to always allocate space for at least 1 element,
actual 0-sized uses are rare and for smaller element types.
2020-08-15 23:22:10 -07:00
Chris Robinson
c5e90ed6c7 Use an enum for FamCount 2020-05-19 12:15:57 -07:00
Chris Robinson
e123fa0ec3 Apply some alloc and alignment attributes 2020-04-10 11:05:25 -07:00
Chris Robinson
97c11577cd Make a default/empty constructor noexcept 2020-04-09 19:32:02 -07:00
Chris Robinson
eed8407599 Remove some unused functions 2020-03-23 17:18:11 -07:00
Chris Robinson
6a3b3b180b Add a macro to disable class-specific new/delete 2020-03-23 16:00:50 -07:00
Chris Robinson
49b2d703e7 Properly define the new[] and delete[] operators 2020-03-22 13:28:45 -07:00
Chris Robinson
9ce182228d Avoid some pre-C++14 workarounds 2020-03-22 08:51:06 -07:00
Chris Robinson
819763a6c2 Fix some 'ambiguous' calls for newer MSVC 2020-01-06 01:40:21 -08:00
Chris Robinson
e9ee6dd239 Ensure a pointer is provided for a templated iterator type 2020-01-05 23:17:26 -08:00
Chris Robinson
f8ff4e269b Put the pragma defines in a separate header 2019-10-07 15:26:35 -07:00
Chris Robinson
0063f4bfac Add some allocator fields GCC 6.3 seems to want 2019-10-01 01:49:21 -07:00
Chris Robinson
24a1058952 Work around MSVC's lack of standard _Pragma support 2019-09-18 13:58:04 -07:00
Chris Robinson
b8f64155e9 Silence a couple specific warning instances 2019-09-18 13:24:16 -07:00
Chris Robinson
b71eb4dafd Don't use [[nodiscard]] in C++11
To silence some warnings in older compilers, and fix an error with newer MSVC.
2019-09-12 04:30:52 -07:00
Chris Robinson
14c76ca244 Fix allocator comparison operators 2019-09-11 07:32:14 -07:00
Chris Robinson
5b37e2339b Simplify flexible array member usage 2019-09-11 03:59:53 -07:00
Chris Robinson
c6c5048416 Don't inherit for the allocator 2019-09-11 03:22:10 -07:00
Chris Robinson
559d1666b8 Add a Create method to FlexArray for "raw" arrays 2019-08-03 14:59:01 -07:00
Chris Robinson
f0408809d6 Cleanup common sources' includes 2019-07-29 09:29:35 -07:00
Chris Robinson
c9ffa9d466 Add C++17-like uninitialized_move methods 2019-07-01 12:33:39 -07:00
Chris Robinson
cbcee69ed1 Add an empty() method to FlexArray 2019-06-29 18:53:20 -07:00
geneotech
499aa65a4b Fix ambiguous calls to destroy_at 2019-06-21 18:25:09 +02:00
Chris Robinson
bc8f206ee1 Use a FlexArray for the context's voices 2019-06-09 18:13:54 -07:00
Chris Robinson
7988bc6e91 Add and use proper types for FlexArray 2019-06-07 23:42:31 -07:00
Chris Robinson
39c2b18cd4 Remove a couple unused functions 2019-06-06 00:42:59 -07:00
Chris Robinson
585b0cf3be Remove the DEF_ALIGN macro 2019-06-06 00:37:00 -07:00
Chris Robinson
142721df17 Add methods to construct and destruct objects in-place 2019-06-05 16:38:53 -07:00
Chris Robinson
f0bc9d8a9b Improve alignment handling for the alignment allocator 2019-06-03 22:58:56 -07:00