release-builds

What does ConditionalAttribute on an Attribute do?

末鹿安然 提交于 2019-12-22 12:07:48
问题 I know what ConditionalAttribute does. The docs say it can also be applied to a class, if it's derived from Attribute : [Conditional("DEBUG")] public class FooAttribute : Attribute { } But how does that custom attribute behave? (Is it stripped out of a release build?) 回答1: @RicardoPontual's comment gave me an idea. I did this: [Conditional("DEBUG")] public class FooAttribute : Attribute { } [Foo] public class Bar { } I compiled in debug mode , and loaded the DLL in ILSpy (it's a disassembler)

What does ConditionalAttribute on an Attribute do?

六月ゝ 毕业季﹏ 提交于 2019-12-06 10:39:20
I know what ConditionalAttribute does. The docs say it can also be applied to a class, if it's derived from Attribute : [Conditional("DEBUG")] public class FooAttribute : Attribute { } But how does that custom attribute behave? (Is it stripped out of a release build?) @RicardoPontual's comment gave me an idea. I did this: [Conditional("DEBUG")] public class FooAttribute : Attribute { } [Foo] public class Bar { } I compiled in debug mode , and loaded the DLL in ILSpy (it's a disassembler). This is what I found, as expected: [Foo] public class Bar { } Then I compiled in release mode , and loaded

Is it possible to remove symbols from a shared library built with Android NDK?

て烟熏妆下的殇ゞ 提交于 2019-12-04 22:14:22
问题 I'm building a shared library for use in a Java app using the Android NDK. Using readelf to inspect the lib/armeabi-v7a/libXXXlib.so file generated by a release build, it appears to contain all the symbols (function, variable names) of my native C/C++ code. Indeed, the shared object file appears to be identical for the debug and release builds. (The only difference in the output in the libs folder being whether or not the gsb.setup and gdbserver files are created.) I'm overriding the

Is it possible to remove symbols from a shared library built with Android NDK?

房东的猫 提交于 2019-12-03 14:27:08
I'm building a shared library for use in a Java app using the Android NDK. Using readelf to inspect the lib/armeabi-v7a/libXXXlib.so file generated by a release build, it appears to contain all the symbols (function, variable names) of my native C/C++ code. Indeed, the shared object file appears to be identical for the debug and release builds. (The only difference in the output in the libs folder being whether or not the gsb.setup and gdbserver files are created.) I'm overriding the optimisation set by the NDK with an APP_CFLAGS += -O3 in my Application.mk , but I wouldn't expect the release

ARC weak ivar released before being returned - when building for release, not debug

别说谁变了你拦得住时间么 提交于 2019-11-29 14:31:07
I have a class that creates an object lazily and stores it as a weak property. Other classes may request this object, but must obviously keep a strong reference to it to keep the object from being deallocated: // .h @interface ObjectManager @property(nonatomic, weak, readonly) NSObject *theObject; @end // .m @interface ObjectManager () @property(nonatomic, weak, readwrite) NSObject *theObject; @end @implementation ObjectManager - (NSObject *)theObject { if (!_theObject) { _theObject = [[NSObject alloc] init]; // Perform further setup of _theObject... } return _theObject; } @end When the scheme

ARC weak ivar released before being returned - when building for release, not debug

回眸只為那壹抹淺笑 提交于 2019-11-28 08:38:21
问题 I have a class that creates an object lazily and stores it as a weak property. Other classes may request this object, but must obviously keep a strong reference to it to keep the object from being deallocated: // .h @interface ObjectManager @property(nonatomic, weak, readonly) NSObject *theObject; @end // .m @interface ObjectManager () @property(nonatomic, weak, readwrite) NSObject *theObject; @end @implementation ObjectManager - (NSObject *)theObject { if (!_theObject) { _theObject = [