Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset f450280 in mainline


Ignore:
Timestamp:
2009-07-13T21:24:30Z (12 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master
Children:
7d88587
Parents:
44539b4c
Message:

Fix alignment errors in realloc().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/malloc.c

    r44539b4c rf450280  
    385385       
    386386        void *ptr = NULL;
    387         size_t real_size = GROSS_SIZE(size);
     387        size_t real_size = GROSS_SIZE(ALIGN_UP(size, BASE_ALIGN));
    388388        size_t orig_size = head->size;
    389389       
     
    410410                        block_check(next_head);
    411411                        block_init(head, head->size + next_head->size, false);
    412                         split_mark(head, size);
     412                        split_mark(head, ALIGN_UP(size, BASE_ALIGN));
    413413                       
    414414                        ptr = ((void *) head) + sizeof(heap_block_head_t);
Note: See TracChangeset for help on using the changeset viewer.