[PR #21] [MERGED] Binary compatibility with the Apple Plist format #53

Closed
opened 2026-01-30 21:26:56 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/claunia/plist-cil/pull/21
Author: @qmfrederik
Created: 3/7/2017
Status: Merged
Merged: 5/20/2017
Merged by: @claunia

Base: masterHead: fixes/binary-compatibility


📝 Commits (3)

  • 6c95260 Maintain binary compatibility with the Apple format: disable optimizations and add the same UID, NSArray and NSString values multiple times to the property list file.
  • 8dc5f8b Make sure that the NSString which represents keys in a NSDictionary is always the same value, by caching the string to NSString conversion in a dictionary
  • b4974ac Don't reuse object IDs for NSNumber objects

📊 Changes

2 files changed (+57 additions, -10 deletions)

View changed files

📝 plist-cil/BinaryPropertyListWriter.cs (+39 -7)
📝 plist-cil/NSDictionary.cs (+18 -3)

📄 Description

We use plist-cil to implement one of Apple's protocols, and we strive to get binary compatibility. That is, we generate the exact same value on disk as the macOS tools do.

We've noticed that plist-cil tries to re-use object IDs in a property list: if you add the same object twice, the BinaryPropertyListWriter will add it once to the property list file and re-use the same ID.

Unfortunately, we hit a scenario where we need to write same value twice to the file, with different IDs.

This PR implements that. Because it would be a pitty to loose the optimization, we've added a ReuseObjectIds property which can be used to control this behavior.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/claunia/plist-cil/pull/21 **Author:** [@qmfrederik](https://github.com/qmfrederik) **Created:** 3/7/2017 **Status:** ✅ Merged **Merged:** 5/20/2017 **Merged by:** [@claunia](https://github.com/claunia) **Base:** `master` ← **Head:** `fixes/binary-compatibility` --- ### 📝 Commits (3) - [`6c95260`](https://github.com/claunia/plist-cil/commit/6c9526015786d30be8933b09754d5060e16e1359) Maintain binary compatibility with the Apple format: disable optimizations and add the same UID, NSArray and NSString values multiple times to the property list file. - [`8dc5f8b`](https://github.com/claunia/plist-cil/commit/8dc5f8ba24accc65a48dcb87ce9ec88bdfe689dd) Make sure that the NSString which represents keys in a NSDictionary is always the same value, by caching the string to NSString conversion in a dictionary - [`b4974ac`](https://github.com/claunia/plist-cil/commit/b4974acba9bb1c20cd0ec591d17a403fcdeb9b9e) Don't reuse object IDs for NSNumber objects ### 📊 Changes **2 files changed** (+57 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `plist-cil/BinaryPropertyListWriter.cs` (+39 -7) 📝 `plist-cil/NSDictionary.cs` (+18 -3) </details> ### 📄 Description We use plist-cil to implement one of Apple's protocols, and we strive to get binary compatibility. That is, we generate the exact same value on disk as the macOS tools do. We've noticed that plist-cil tries to re-use object IDs in a property list: if you add the same object twice, the `BinaryPropertyListWriter` will add it once to the property list file and re-use the same ID. Unfortunately, we hit a scenario where we need to write same value twice to the file, with different IDs. This PR implements that. Because it would be a pitty to loose the optimization, we've added a `ReuseObjectIds` property which can be used to control this behavior. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-30 21:26:56 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: claunia/plist-cil#53