Commit graph

4 commits

Author SHA1 Message Date
Kalesh Singh
41c8951c91 bionic: tests: Remove PAGE_SIZE usage
Instead of the hardcoded PAGE_SIZE 4096 macro, use the
real system page-size as queried from the auxillary vector.

Bug: 277272383
Bug: 300367402
Test: atest -c bionic-unit-tests
Change-Id: I2f1ad1b431e36ef45e9f53f713ced6b06e0d4f70
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-19 15:49:50 -07:00
Elliott Hughes
68ae6ad12e Changes for #inclusivefixit.
Test: treehugger
Change-Id: I7ff0496c5c2792a41781e74634247f55b0548213
2020-07-21 16:34:58 -07:00
Ryan Prichard
96773a2daf Add BionicAllocator::memalign
Bionic needs this functionality to allocate a TLS segment with greater
than 16-byte alignment. For simplicity, this allocator only supports up
to one page of alignment.

The memory layout changes slightly when allocating an object of exactly
PAGE_SIZE alignment. Instead of allocating the page_info header at the
start of the page containing the pointer, it is allocated at the start
of the preceding page.

Bug: http://b/78026329
Test: linker-unit-tests{32,64}
Change-Id: I1c8d1cd7ca72d113bced5ee15ba8d831426b0081
2019-01-25 15:31:35 -08:00
Ryan Prichard
083d850b30 Move the linker allocator into libc
Rename LinkerMemoryAllocator -> BionicAllocator
Rename LinkerSmallObjectAllocator -> BionicSmallObjectAllocator

libc and the linker need to share an instance of the allocator for
allocating and freeing dynamic ELF TLS memory (DTVs and segments). The
linker also continues to use this allocator.

Bug: http://b/78026329
Test: /data/nativetest/bionic-unit-tests-static
Test: /data/nativetest64/bionic-unit-tests-static
Test: /data/nativetest/linker-unit-tests/linker-unit-tests32
Test: /data/nativetest64/linker-unit-tests/linker-unit-tests64
Change-Id: I2da037006ddf8041a75f3eba2071a8fcdcc223ce
2019-01-25 15:31:35 -08:00
Renamed from linker/tests/linker_memory_allocator_test.cpp (Browse further)