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
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
Chris Robinson
40c6f74bb7
Add front and back methods to FlexArray
2019-01-17 02:23:57 -08:00
Chris Robinson
77447fcd54
Add placement operator delete
2019-01-11 20:06:23 -08:00
Chris Robinson
852c5005ab
Add a missing include
2019-01-11 08:07:25 -08:00
Chris Robinson
8aedaea5fb
Add a flexible array template container
2019-01-11 06:00:41 -08:00
Chris Robinson
2f1566e0b4
Add and use a make_unique function
2019-01-01 14:33:01 -08:00
Chris Robinson
67b874328d
Use static_cast instead of reinterpret_cast where possible
2018-12-28 16:13:28 -08:00
Chris Robinson
08b79b9bbf
Add an assume_aligned helper
2018-12-20 11:46:40 -08:00
Chris Robinson
ba8c865513
Add and use a macro to define placement-new-only allocators
...
This is for structs that utilize over-allocation, either flexible array
members, or which store optional additional objects in the same allocation
block.
2018-11-22 07:06:42 -08:00
Chris Robinson
4dc8f44d00
Move the alignment-aware allocator and vector to headers
2018-11-18 01:33:26 -08:00
Chris Robinson
d7cc9b912b
Use new/delete for ALCcontext objects
2018-11-18 00:38:31 -08:00
Chris Robinson
3baf9d0e81
Add a method to get the system's page size
2018-01-16 19:28:10 -08:00
Chris Robinson
afb59e7f98
Move internal headers out of the include directory
2017-04-14 18:15:56 -07:00