mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibPDF: Store indirect value refs in Value objects
IndirectValueRef is so simple that it can be stored directly in the Value class instead of being heap allocated. As the comment in Value says, however, in theory the max bits needed to store is 48 (16 for the generation index and 32(?) for the object index), but 32 should be good enough for now. We can increase it to u64 later if necessary.
This commit is contained in:
parent
534a2e95d2
commit
be6e4b6f3c
7 changed files with 56 additions and 54 deletions
|
@ -30,7 +30,7 @@ NonnullRefPtr<Object> DictObject::get_object(Document* document, const FlyString
|
|||
{ \
|
||||
return document->resolve_to<class_name>(get(key).value()); \
|
||||
}
|
||||
ENUMERATE_DIRECT_OBJECT_TYPES(DEFINE_ACCESSORS)
|
||||
ENUMERATE_OBJECT_TYPES(DEFINE_ACCESSORS)
|
||||
#undef DEFINE_INDEXER
|
||||
|
||||
static void append_indent(StringBuilder& builder, int indent)
|
||||
|
@ -132,9 +132,4 @@ String IndirectValue::to_string(int indent) const
|
|||
return builder.to_string();
|
||||
}
|
||||
|
||||
String IndirectValueRef::to_string(int) const
|
||||
{
|
||||
return String::formatted("{} {} R", index(), generation_index());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue