- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 63
changed behaviour of malloc(0) and optimized calloc #631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
__TICE__ only)432c6ba    to
    07d546f      
    Compare
  
            
          
                src/libc/calloc.src
              
                Outdated
          
        
      | ; inlined memset/bzero | ||
| ; assumes that malloc(0) returns NULL, so we can skip the check for zero size | ||
| add hl, bc | ||
| cpd | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it is okay for cpd to read nonnull_ptr_from_malloc + size
07d546f    to
    132611a      
    Compare
  
    | To reduce the complexity of this PR, I undid the  
 | 
132611a    to
    2669acc      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all checks pass, seems good.
__simple_mallocand__standard_mallocnow returnNULLwhenmalloc(0)is called.calloc(when__TICE__is defined) now uses an inlined implementation ofbzerowhich uses the$E40000address to speed up the zero filling of memory.Otherwise, it will use the previous
memsetimplementation when__TICE__is undefined.