in reply to Re^2: [OT] Stats problem
in thread [OT] Stats problem

I see, what you propose makes sense.

You can also mix both the offset and the magic marker using xor:

mem[ix] = ix ^ magic_value;

Replies are listed 'Best First'.
Re^4: [OT] Stats problem
by BrowserUk (Patriarch) on Feb 27, 2015 at 12:08 UTC
    You can also mix both the offset and the magic marker using xor:

    I'm not sure there would be any advantage in that? I don't think the combined value would retain the rarity factor of the magic number; nor the uniqueness of the offset.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
      Because an offset/ptr follows a too simple pattern and potentially there could exist specific bugs patterns where the overwriting data and the marker match.

      The xor-with-a-constant operation has the interesting property of keeping the variability, it would just made the ptr values not look like ptrs.

      In other words if for instance you have an array a with 10 elements, the probability of your code generating the value a+10 is higher than (a+10)^0xdeadbee5.

        In other words if for instance you have an array a with 10 elements, the probability of your code generating the value a+10 is higher than (a+10)^0xdeadbee5.

        Interesting. I'll add it to my simulation.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
        In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked