32-bit

objc_setAssociatedObject function error in 64bit mode not in 32bit

ε祈祈猫儿з 提交于 2019-12-29 04:48:05
问题 I am using a neat table view controller called SKSTableView in my project which allows each table row to have a number of sub rows. This code works perfectly in 32bit mode but when I run it on my iPhone 5S or in the Simulator in 4-inch 64bit mode, when you tap on a row to get the sub rows it crashes. I do not have any knowledge of the differences of 64bit and 32bit iOS systems. I would love to understand what it happening here. You will notice that the *SubRowObjectKey is set to void- the

fast way to check if an array of chars is zero [duplicate]

浪子不回头ぞ 提交于 2019-12-28 05:28:28
问题 This question already has answers here : Faster approach to checking for an all-zero buffer in C? (20 answers) Closed 11 months ago . I have an array of bytes, in memory. What's the fastest way to see if all the bytes in the array are zero? 回答1: Nowadays, short of using SIMD extensions (such as SSE on x86 processors), you might as well iterate over the array and compare each value to 0. In the distant past , performing a comparison and conditional branch for each element in the array (in

Force gcc to compile 32 bit programs on 64 bit platform

不想你离开。 提交于 2019-12-28 04:54:22
问题 I've got a proprietary program that I'm trying to use on a 64 bit system. When I launch the setup it works ok, but after it tries to update itself and compile some modules and it fails to load them. I'm suspecting it's because it's using gcc and gcc tries to compile them for a 64 bit system and therefore this program cannot use these modules. Is there any way (some environmental variables or something like that) to force gcc to do everything for a 32 bit platform. Would a 32 bit chroot work?

What is the maximum memory available to a C++ application on 32-bit Windows?

梦想的初衷 提交于 2019-12-28 04:08:06
问题 Just wondering if there is a restriction on the max memory that a C++ application uses I understand that this is 2GB - Is that correct? If a C++ app tries to request more then 2GB memory does this cause a memory crash? Final question - If the machine the C++ app is running on is already low on memory and a C++ app asks for 100MB of array (ie contiguous memory) will the OS accommodate this by using virtual memory? 回答1: It will cause a dynamic memory allocation failure, which usually will make

Size of pid_t, uid_t, gid_t on Linux

僤鯓⒐⒋嵵緔 提交于 2019-12-28 03:45:30
问题 On Linux systems (either 32- or 64-bit), what is the size of pid_t , uid_t , and gid_t ? 回答1: #include <stdio.h> #include <sys/types.h> int main() { printf("pid_t: %zu\n", sizeof(pid_t)); printf("uid_t: %zu\n", sizeof(uid_t)); printf("gid_t: %zu\n", sizeof(gid_t)); } EDIT: Per popular request (and because, realistically, 99% of the people coming to this question are going to be running x86 or x86_64)... On an i686 and x86_64 (so, 32-bit and 64-bit) processor running Linux >= 3.0.0, the answer

How to make Android apps which support both 32-bit and 64-bit architecture?

烂漫一生 提交于 2019-12-27 17:37:13
问题 I've just received and read a newsletter from Google Play mentioning that from next year on, the store "will require that new apps and app updates with native libraries provide 64-bit versions in addition to their 32-bit versions". For those who haven't read it yet, it states: 64-bit support requirement in 2019 Platform support for 64-bit architectures was introduced in Android 5.0. Today, over 40% of Android devices coming online have 64-bit support, while still maintaining 32-bit

Converting a pointer into an integer

笑着哭i 提交于 2019-12-27 11:02:51
问题 I am trying to adapt an existing code to a 64 bit machine. The main problem is that in one function, the previous coder uses a void* argument that is converted into suitable type in the function itself. A short example: void function(MESSAGE_ID id, void* param) { if(id == FOO) { int real_param = (int)param; // ... } } Of course, on a 64 bit machine, I get the error: error: cast from 'void*' to 'int' loses precision I would like to correct this so that it still works on a 32 bit machine and as

Reading shorts in 32-bits architectures (for example)

浪子不回头ぞ 提交于 2019-12-25 06:43:40
问题 First of all, sorry for my English. I know architectures are very complex and there's a broad sprectrum of situations, but a common generalization is if a computer architecture has 32-bits words, means registers, memory accesses and buses work with words of 32-bits long (but I think there's a lot of variants in current architectures). Ok, let's suppose this is the rule and our architecture is a little-endian one, as x86. In such a case, if we want to read a short int (2-bytes long), the

How can a 32 bit client communicate with a 64 bit server if long type is passed?

夙愿已清 提交于 2019-12-25 05:35:30
问题 We have a 32-bit C++ GUI application running on 32 bit windows 7. We are planning to migrate our server with C++ apps to 64-bit linux. We have noticed that long types are larger in 64 bit. This will be incompatible with the client-server message passing from 64-bit to 32-bit. What is a good way to solve this incompatibility? Do we need to change the code? How? or Do we use a third party software to do the conversion? What software is it? 回答1: That's why there is the standardized int32_t and

What would be the negative effects of installing a 32bit app into the C:\Program Files\ instead of the C:\Program Files(x86)\?

為{幸葍}努か 提交于 2019-12-24 15:25:44
问题 What would be the negative effects of installing a legacy 32bit app into the C:\Program Files instead of the C:\Program Files(x86) ? 回答1: I don't think it matters. You can run a 64-bit from your Desktop, an external drive, etc. the same way you can run a 32-bit app. I think the difference is purely for organization. Or say you are developing a 32-bit and a 64-bit version of an application, you could install both of them and run them side by side by putting them in the separate Program Files