python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Switching array to vector inside struct, how to handle file io byte alignment
We used to have a structure:
const int NUMBER_OF_ELEMENTS = 10;
struct myStruct1
{
uint32_t var1;
uint64_t var2;
uint32_t elements[NUMBER_OF_ELEMENTS];
};
However, going forward we want...
sacrawford
Votes: 0
Answers: 1
malloc and C alignment: is this hand-made optimization safe?
I put the whole code but, of course, it's in different files (.h and .c files)
typedef unsigned char ubyte;
typedef unsigned int uint;
#include<stdbool.h>
typedef struct Cube {
ubyte n;
...
Olivier Pons
Votes: 0
Answers: 1
Align struct while minimizing cache line waste
There are many great threads on how to align structs to the cache line (e.g., Aligning to cache line and knowing the cache line size).
Imagine you have a system with 256B cache line size, and a struct...
Maxbit
Votes: 0
Answers: 2
Does packed data type in SSE2 imply alignment?
I'm writing some code that should utilize some type of vectorized instructions in order to compare two arrays consisting of 64-bit integers. I'm thinking of utilizing the SSE2 variant for cmpeq. The t...
aahlback
Votes: 0
Answers: 0