Ignore:
Timestamp:
Dec 30, 2022, 8:42:42 AM (15 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
a14926b
Parents:
d9585291
Message:

add cast from int to unsigned

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/heap.cfa

    rd9585291 ra7662b8  
    1010// Created On       : Tue Dec 19 21:58:35 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 28 12:37:38 2022
    13 // Update Count     : 1597
     12// Last Modified On : Fri Dec 30 08:37:37 2022
     13// Update Count     : 1605
    1414//
    1515
     
    805805
    806806        ptrdiff_t rem = heapRemaining - size;
    807         if ( unlikely( rem < 0 ) ) {
     807        if ( unlikely( rem < 0 ) ) {                                            // negative ?
    808808                // If the size requested is bigger than the current remaining storage, increase the size of the heap.
    809809
     
    841841        ptrdiff_t rem = heapReserve - size;
    842842
    843         if ( unlikely( rem < 0 ) ) {                                            // negative
     843        if ( unlikely( rem < 0 ) ) {                                            // negative ?
    844844                // If the size requested is bigger than the current remaining reserve, use the current reserve to populate
    845845                // smaller freeLists, and increase the reserve.
     
    847847                rem = heapReserve;                                                              // positive
    848848
    849                 if ( rem >= bucketSizes[0] ) {                                  // minimal size ? otherwise ignore
     849                if ( (unsigned int)rem >= bucketSizes[0] ) {    // minimal size ? otherwise ignore
    850850                        size_t bucket;
    851851                        #ifdef FASTLOOKUP
     
    856856                        Heap.FreeHeader * freeHead = &(freeLists[bucket]);
    857857
    858                         // The remaining storage many not be bucket size, whereas all other allocations are. Round down to previous
     858                        // The remaining storage may not be bucket size, whereas all other allocations are. Round down to previous
    859859                        // bucket size in this case.
    860860                        if ( unlikely( freeHead->blockSize > (size_t)rem ) ) freeHead -= 1;
Note: See TracChangeset for help on using the changeset viewer.