forked from hsutter/gcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* narrow the result of locations() *after* the division to raise the maximum page size by a few more bits. (Verify in the constructor that total_size / min_alloc <= INT_MAX so that locations() is guaranteed to be representable.) * inuse and starts both need to hold only one bit per location, not one bit per byte. * In the loop in allocate() that is searching for an available space, ensure that we do not misalign i when stepping over an allocated location at j. * In contains(), use std::less<> to compare pointers into potentially differing pages. (< is not portably a total function on pointers, std::less is portably total.) Avoid the same issue in deallocate by checking contains() before calculating the difference of the page base pointer and the function argument. * In lowest_hex_digits_of_address, convert the pointer to uintptr_t instead of size_t. * In debug_print, don't end lines with " \n" when "\n" will do ;) * deferred_heap.h: * Convert the placement argument to void* to ensure we're invoking True Placement New in construct and construct_array. * In construct_array, construct the n elements in n contiguous memory locations instead of in a single memory location. If a constructor throws, cleanup the constructed elements before allowing the exception to propagate. * In collect, don't pass pg.page.locations() to pg.page.location_info() - it's out-of-range. * test.cpp: * Tell the compiler not to warn that p1, p2, p4, & p5 are unused in test_page. * In test_deferred_allocator_set, test explicitly for libstdc++ and libc++ whose implementations of std::set do not like this test.
- Loading branch information
1 parent
5f17581
commit 3a721c3
Showing
4 changed files
with
118 additions
and
75 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
Oops, something went wrong.