mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte string. As the null state has already been removed, there are no other particularly hairy blockers in repurposing this type as a byte string (what it _really_ is). This commit is auto-generated: $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \ Meta Ports Ladybird Tests Kernel) $ perl -pie 's/\bDeprecatedString\b/ByteString/g; s/deprecated_string/byte_string/g' $xs $ clang-format --style=file -i \ $(git diff --name-only | grep \.cpp\|\.h) $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
parent
38d62563b3
commit
5e1499d104
1615 changed files with 10257 additions and 10257 deletions
|
@ -26,20 +26,20 @@ static void free_pages(void* ptr, size_t bytes)
|
|||
VERIFY(rc == 0);
|
||||
}
|
||||
|
||||
NonnullOwnPtr<MmapRegion> MmapRegion::create_anonymous(u32 base, u32 size, u32 prot, DeprecatedString name)
|
||||
NonnullOwnPtr<MmapRegion> MmapRegion::create_anonymous(u32 base, u32 size, u32 prot, ByteString name)
|
||||
{
|
||||
auto* data = (u8*)mmap_initialized(size, 0, DeprecatedString::formatted("(UE) {}", name).characters());
|
||||
auto* data = (u8*)mmap_initialized(size, 0, ByteString::formatted("(UE) {}", name).characters());
|
||||
auto* shadow_data = (u8*)mmap_initialized(size, 1, "MmapRegion ShadowData");
|
||||
auto region = adopt_own(*new MmapRegion(base, size, prot, data, shadow_data));
|
||||
region->m_name = move(name);
|
||||
return region;
|
||||
}
|
||||
|
||||
NonnullOwnPtr<MmapRegion> MmapRegion::create_file_backed(u32 base, u32 size, u32 prot, int flags, int fd, off_t offset, DeprecatedString name)
|
||||
NonnullOwnPtr<MmapRegion> MmapRegion::create_file_backed(u32 base, u32 size, u32 prot, int flags, int fd, off_t offset, ByteString name)
|
||||
{
|
||||
// Since we put the memory to an arbitrary location, do not pass MAP_FIXED and MAP_FIXED_NOREPLACE to the Kernel.
|
||||
auto real_flags = flags & ~(MAP_FIXED | MAP_FIXED_NOREPLACE);
|
||||
auto* data = (u8*)mmap_with_name(nullptr, size, prot, real_flags, fd, offset, name.is_empty() ? nullptr : DeprecatedString::formatted("(UE) {}", name).characters());
|
||||
auto* data = (u8*)mmap_with_name(nullptr, size, prot, real_flags, fd, offset, name.is_empty() ? nullptr : ByteString::formatted("(UE) {}", name).characters());
|
||||
VERIFY(data != MAP_FAILED);
|
||||
auto* shadow_data = (u8*)mmap_initialized(size, 1, "MmapRegion ShadowData");
|
||||
auto region = adopt_own(*new MmapRegion(base, size, prot, data, shadow_data));
|
||||
|
@ -318,10 +318,10 @@ void MmapRegion::set_prot(int prot)
|
|||
}
|
||||
}
|
||||
|
||||
void MmapRegion::set_name(DeprecatedString name)
|
||||
void MmapRegion::set_name(ByteString name)
|
||||
{
|
||||
m_name = move(name);
|
||||
set_mmap_name(range().base().as_ptr(), range().size(), DeprecatedString::formatted("(UE) {}", m_name).characters());
|
||||
set_mmap_name(range().base().as_ptr(), range().size(), ByteString::formatted("(UE) {}", m_name).characters());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue