Navigation

    What the Daily WTF?

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    1. Home
    2. Evilweasil
    E
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Evilweasil

    @Evilweasil

    0
    Reputation
    35
    Posts
    77
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Evilweasil Follow

    Best posts made by Evilweasil

    This user hasn't posted anything yet.

    Latest posts made by Evilweasil

    • RE: Memory management

      @dkf said:

      @Evilweasil said:
      The following code validates/invalidates my right to an opinion:
      FTFY. Good thing you covered both bases there...

      We all know by now that general helpfulness is how I stay employed.

      Would you like me to get you some coffee?

      posted in Side Bar WTF
      E
      Evilweasil
    • RE: Memory management

      @PJH said:

      @Evilweasil said:
      If the call to realloc returns a new pointer to a new memory allocation, then the old memory allocation has no pointer, and is not released properly (unless the caller handles it).

      You appear to be under the impression that realloc() doesn't free the old block if a new block is allocated. Your impression is wrong.

      @Evilweasil said:

      <god-awful code>
      Your implementation of realloc() fails in (at least) two ways:

      1. it doesn't copy the contents of the old block of memory to the new block
      2. it always assigns a new block of memory, even in the cases where realloc() wouldn't. (e.g. if the block is smaller, the same size, or could fit in the current position with an extension.)

      I would fall back on the reliable defense of "I don't use C much" but that seems to go without saying here.

      posted in Side Bar WTF
      E
      Evilweasil
    • RE: Memory management

      From a quick look at realloc, it may or may not return a pointer to the same allocated memory.[1] If the call to realloc returns a new pointer to a new memory allocation, then the old memory allocation has no pointer, and is not released properly (unless the caller handles it).

      As a function that is supposed to reduce the burden of memory management, this one isn't very good at all. The following code validates/invalidates my right to an opinion:

      void IncreaseArray(void **pArray, bool *pIsAllocated, size_t Size){



       *pIsAllocated = false;


       if(*pArray){

        void *pTemp = *pArray;

        *pTemp = realloc(*pTemp,Size);

        if(*pTemp){

         *pIsAllocated = true;

         free(pArray);

         pArray = pTemp;

         }

       }

       else{

        *pArray = malloc(Size);

        if(*pArray){

         *pIsAllocated = true;

         }

       }

      }

      posted in Side Bar WTF
      E
      Evilweasil
    • RE: Hey guys, remember how all the tags on the forum are encoded into every post form?

      @Ben L. said:

      walley&walley&wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank&wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+<br >wank+wank+wank+wank+wank&wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wankwank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank<br >+wank+wank+wank+wank&wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wankwank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank+wank<br >+wank+wank+wank

      This speaks magnitudes about the site as a whole.

      posted in Side Bar WTF
      E
      Evilweasil
    • RE: Excel clears undo stack in AutoRecover.

      @Tae Wong said:

      However, the undo buffer seems to erase itself every time you correct the spelling in Excel older versions.

      Never ask someone to reply with funny stuff like “very zen”, “the beast at tanagra” etc... Vulgarity?

      Shaka, when the walls fell.

      posted in Side Bar WTF
      E
      Evilweasil
    • RE: One room, many exits

      Print out a couple thousand copies of the output, then use that paper to crush the person(s) responsible.

      posted in Side Bar WTF
      E
      Evilweasil
    • RE: Triumverate of Fail

      @Lorne Kates said:

      Y'know those videos that were popular a couple years back-- they'd take a still photo of your face and superimpose it overtop a dancing elf or some shit like that?  

      Not really what I was trying to communicate, but okay...

      @Lorne Kates said:

      ...those touched my uncanny valley in a no-no way.

      Oh dear god. Why?

      posted in Side Bar WTF
      E
      Evilweasil
    • RE: Triumverate of Fail

      @Lorne Kates said:

      I gladly would post a link so y'all could have fun watching me flail about while trying to remember choreography-- unfortunately the videos also contain about twenty other students doing the same thing who would prefer that to stay non-viral

      All you need to do is get out some video-editing software and edit all of the other students out of the video. Then you can hog all the viral for yourself.

      posted in Side Bar WTF
      E
      Evilweasil
    • RE: The path to extra work.

      @Cassidy said:

      I expect some snoofle-level tales forthcoming - or a dev-sized bump under your patio slabs - in the forthcoming weeks.

      So THAT'S where you hide the bodies!

      posted in Side Bar WTF
      E
      Evilweasil
    • RE: The tale of min and max.

      Bulb: I know how you feel. I've also had this sort of problem with Windows CE.

      I think my issues related to DirectX, though.

      posted in Side Bar WTF
      E
      Evilweasil