32bit

How do you write code that is both 32 bit and 64 bit compatible ?

What considerations do I need to make if I want my code to run correctly on both 32bit and 64bit platforms ? EDIT: What kind of areas do I need to take care in, e.g. printing strings/characters or using structures ? ...

Writing cross-platform apps in C

What things should be kept most in mind when writing cross-platform applications in C? Targeted platforms: 32-bit Intel based PC, Mac, and Linux. I'm especially looking for the type of versatility that Jungle Disk has in their USB desktop edition ( http://www.jungledisk.com/desktop/download.aspx ) What are tips and "gotchas" for this ty...

Store more than 3GB of video-frames in memory, on 32-bit OS

At work we have an application to play 2K (2048*1556px) OpenEXR film sequences. It works well.. apart from when sequences that are over 3GB (quite common), then it has to unload old frames from memory, despite the fact all machines have 8-16GB of memory (which is addressable via the linux BIGMEM stuff). The frames have to he cached into...

How come a 32 bit kernel can run a 64 bit binary?

On my OS X box, the kernel is a 32 bit binary and yet it can run a 64 bit binary. How does this work? cristi:~ diciu$ file ./a.out ./a.out: Mach-O 64-bit executable x86_64 cristi:~ diciu$ file /mach_kernel /mach_kernel: Mach-O universal binary with 2 architectures /mach_kernel (for architecture i386): Mach-O executable i386 /mach_ker...

32 vs 64 bits... what's the big deal?

Why is it considered to be such a big deal to have a 64-bit computer? Why does it "change everything?" Why do applications need to be designed differently between 32- and 64-bit platforms? And, on OS X, how do you find which one you have!? ...

SHGetFolderPath() 32 bit vs 64 bit

What happens if I use HGetFolderPath api call in a 32 bit system with CSIDL_PROGRAM_FILESx86 folder id, instead of the CSIDL_PROGRAM_FILES id ? Theoretically CSIDL_PROGRAM_FILESx86 should map to C:\program files (x86) in a 64 bit system but what does it map to in a 32 bit system where this path doesn't exists? Thanks in advanced. ...

Converting a pointer into an integer

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; // ... ...

Development PC: AMD vs Intel and 32-bit vs 64-bit

I am looking to purchase a new development PC. My budget is not more than $1,000 USD (including monitor). I am open to laptop (desktop replacement type) or the traditional desktop PC would do just fine. My primary development environment will be Microsoft, Visual Studio 2008 (and support of older Visual Studio 6 code as well). SQL Se...

On 32-bit CPUs, is an 'integer' type more efficient than a 'short' type?

On a 32-bit CPU, an integer is 4 bytes and a short integer is 2 bytes. If I am writing a C/C++ application that uses many numeric values that will always fit within the provided range of a short integer, is it more efficient to use 4 byte integers or 2 byte integers? I have heard it suggested that 4 byte integers are more efficient as ...

Is it safe to assume an int will always be 32 bits in C#?

In my C# source code I may have declared integers as: int i = 5; or Int32 i = 5; In the currently prevalent 32bit world they are equivalent. However, as we move into a 64bit world am I correct in saying that the following will become the same? int i = 5; Int64 i = 5; ...

Determining 64-bit vs. 32-bit Windows

I'd like to configure visual studio 2005 to copy .dll's based on whether the OS is 64-bit or 32-bit during a build. I do not want to specify what the platform target is. My first attempt was to use a batch file to lookup the Windows version, but some 32-bit and 64-bit versions of Windows share the same version number. Anyone know of...

Running on 32 or 64 bit matlab?

How can I determine if I'm running on a 32bit or a 64bit version of matlab? I have some pre-compiled mex-files which need different path's depending on 32/64bit matlab. edit Found solution The function computer returns the architecture I'm running on. so: switch computer case 'GLNX86' display('32-bit stuff') case 'GLN...

Java: How does the VM handle a 64bit `long` on a 32bit processor

How does the JVM handle a primitive "long", which is 64bits, on a 32bit processor? Can it utilise mulitple cores in parallel when on a Multi-Core 32bit machine? How much slower are 64bit operations on a 32bit machine? ...

Is there a bandwidth improvement from installing a 32-bit operating system on a 64-bit machine?

Knuth recently objected to 64-bit systems, saying that for programs which fit in 4 gigs of memory, "they effectively throw away half of the cache" because the pointers are twice as big as on a 32-bit system. My question is: can this problem be avoided by installing a 32-bit operating system on a 64-bit machine? And are there any bandw...

How do I tell if my application is running as a 32 or 64 bit application?

I'm trying to figure out how to tell if my application (compiled in VS2008 as Any CPU) is running as a 32 or 64 bit app. ...

memcpy performance differences between 32 and 64 bit processes

We have Core2 machines (Dell T5400) with XP64. We observe that when running 32-bit processes, the performance of memcpy is on the order of 1.2GByte/s; however memcpy in a 64-bit process achieves about 2.2GByte/s (or 2.4GByte/s with the Intel compiler CRT's memcpy). While the initial reaction might be to just explain this away as due to...

What are the actual performance differences between Int64 and Int32 on 32 and 64 bit MS Windows?

What are the actual performance differences between Int64 and Int32 on 32 and 64 bit MS Windows? It would also be great to see some actual timings of Int64 vs Int32 on each of the two operating system variants. XP or Vista would also be interesting. See also this question about memcpy performance. ...

Should .NET AnyCPU projects bind to Framework or Framework64 DLLs

I have a csproj that has a reference to the Framework64 version of System.Data. When I try to build using MSBUILD/TFS on another machine it fails as the 64-bit DLL doesn't exist. Should I bind to the Framework version, or will this limit me when running on 64-bit machines? Does .NET redirect the binding to use 64-bit when possible? ...

Can autotools create multi-platform makefiles

I have a plugin project I've been developing for a few years where the plugin works with numerous combinations of [primary application version, 3rd party library version, 32-bit vs. 64-bit]. Is there a (clean) way to use autotools to create a single makefile that builds all versions of the plugin. As far as I can tell from skimming t...

win32 gui, pixel access with opengl? w/o killing performance?

I want to make a editor and need normal win32 buttons such as textbox, buttons, etc. I also need a control for pixel access. I really dont like GDI so i am thinking i should do it with opengl. I havent done it before and i want to know if this is a bad idea before i write any code. This is what i am thinking to do this. Create a normal ...