|
From: | Amr Aboelela |
Subject: | Re: [NSNumber numberWithFloat:] issue |
Date: | Thu, 19 Feb 2015 11:06:36 -0800 |
Hi Stefan,
Try:
CFRetain([NSNumber numberWithFloat:0.25])
It will crash
ThanksThat's because CoreBase does not understand "small objects". These are objects that have their contents stored as part of the pointer, instead of being an actual object. Because they aren't actually objects, they don't have any reference counting. Passing a small object around is like passing a int or double, and do not have to call malloc or free, making them very fast.I can implement a quick fix, but it might not until the weekend. It would also be very helpful if you created a test case that I could include in the test suite. Nothing fancy. Or, if you're not familiar with the test suite, a simple program with the expected output.On Wed, Feb 18, 2015 at 6:16 PM, Amr Aboelela <amraboelela@gmail.com> wrote:_______________________________________________Hello,I found that [NSNumber numberWithFloat:] is not toll free bridged with CoreFoundationif you do CFRetain on an object result from [NSNumber numberWithFloat:] it will crash, and if you do a retainCount on it, it will always give you -1I feel suspicious about this line:return boxDouble(aValue, SMALL_FLOAT_MASK);
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
[Prev in Thread] | Current Thread | [Next in Thread] |