-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(container): make Linked_Bump_Allocator use run-time alignment
Linked_Bump_Allocator is coded to align all allocations to 'alignment' (typically 8). This is problematic for a few reasons: 1. 'alignment' is specified as a compile-time template parameter, forcing Linked_Bump_Allocator to be a template. This probably slows down compilation and clutters the header file. (This is the main problem motivating this patch.) 2. Allocations perform run-time alignment anyways, but on the size rather than on the pointer. 3. The forced alignment wastes some space. 4. Linked_Bump_Allocator cannot support overaligned data. (This isn't a problem yet, and I don't forsee this being a real problem. I mention this for completeness.) Teach Linked_Bump_Allocator to align everything according to a run-time alignment. This will let us fix issue #1 later, directly fixes issue #3, and (with some work included in this patch) fixes #4. This patch might have negative performance costs. I did not measure.
- Loading branch information
Showing
4 changed files
with
85 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters