Questions tagged [memory-aliasing]

7 questions
4
votes
1 answer

Why is assigning a container's element to the container (not) a well-defined C++?

In C++ there is the infamous problem of self-assignment: when implementing operator=(const T &other), one has to be careful of the this == &other case to not destroy this's data before copying it from other. However, *this and other may interact in…
1
vote
1 answer

ARM Trustzone memory aliasing

I am trying to understand the ARM Trustzone implementation and came across the memory aliasing wherein the same memory is interpreted as secure and non-secure based on the 33rd bit of that address. I am not able to understand the concept of memory…
1
vote
0 answers

Why do assembly need repeated operation of movzx on eax?

Code - Difference is one method is for signed short int-s and another for unsigned short int. short signedShortIntSwap(short int* a , short int* b) { short tmp = *a; *a = *b; *b = tmp; return *a; } unsigned short…
Sreeraj Chundayil
  • 5,548
  • 3
  • 29
  • 68
1
vote
2 answers

OpenCL inter-context buffer aliasing

Suppose I have 2 OpenCL-capable devices on my machine (not including CPUs); and suppose that an evil colleague of mine creates a different context for each of them, which I have to work with. I know I can't share buffers between contexts - not…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
0
votes
0 answers

How bad is memory aliasing with modern C++ compilers?

I am trying to understand the effects of memory aliasing and how to improve my code to avoid it. I am re-writing my cache coherent Entity Component System and I want to take memory aliasing into account. The main source I have is Christer Ericson's…
0
votes
0 answers

memory aliasing in llvm

Would someone please show me how, by the means provided by the llvm library, to establish that ( in the clang-generated IR file ) ‘foo1’ is not affected by ‘foo’: extern double d[3]; __attribute__((noinline)) double foo1() { return d[2]; …
0
votes
0 answers

Aliasing a placeholding buffer in base class from derived class

I want to create an array of struct objects that each contain a member which holds a value. However, this value might differ in its type from object to object. As the size can't vary I decided to put a placeholding buffer in the base class which I…
glades
  • 3,778
  • 1
  • 12
  • 34