Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C / C++ / MFC
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    joshp1217
    wrote on last edited by
    #1

    [Message Deleted]

    T realJSOPR 2 Replies Last reply
    0
    • J joshp1217

      [Message Deleted]

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      why on hell are you modifying a function of the C runtime ??? :wtf: if your compilation fails, it's because of your code, not the sources provided with the compiler (even if the compiler reported the error in memcpy()) :doh:


      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      J 1 Reply Last reply
      0
      • T toxcct

        why on hell are you modifying a function of the C runtime ??? :wtf: if your compilation fails, it's because of your code, not the sources provided with the compiler (even if the compiler reported the error in memcpy()) :doh:


        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        J Offline
        J Offline
        joshp1217
        wrote on last edited by
        #3

        No No this is a question I have to answer, I am just checking to make sure the function code show doesnt cause cause any problems and it is efficient code.

        H 1 Reply Last reply
        0
        • J joshp1217

          [Message Deleted]

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          There's absolutely no reason to post this twice.

          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          1 Reply Last reply
          0
          • J joshp1217

            No No this is a question I have to answer, I am just checking to make sure the function code show doesnt cause cause any problems and it is efficient code.

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            You delete your question!?


            WhiteSky


            J 1 Reply Last reply
            0
            • H Hamid Taebi

              You delete your question!?


              WhiteSky


              J Offline
              J Offline
              joshp1217
              wrote on last edited by
              #6

              Yeah they said that I didnt need to post it twice but the question basically was: What is wrong or how can I improve this function: void* memcpy( void* dest, void* src, size_t size ) { byte* pTo = (byte*)dest; byte* pFrom = (byte*)src; assert( dest != NULL && src != NULL ); while( size-- > 0 ) *pTo++ = *pFrom++; return (dest); }

              J 1 Reply Last reply
              0
              • J joshp1217

                Yeah they said that I didnt need to post it twice but the question basically was: What is wrong or how can I improve this function: void* memcpy( void* dest, void* src, size_t size ) { byte* pTo = (byte*)dest; byte* pFrom = (byte*)src; assert( dest != NULL && src != NULL ); while( size-- > 0 ) *pTo++ = *pFrom++; return (dest); }

                J Offline
                J Offline
                Jeffrey Walton
                wrote on last edited by
                #7

                Hi Josh, You're copying a byte at a time... it is not as efficient as it could be on architectures such as x86 which has SIMD instructions. Jeff

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups