Ignore:
Timestamp:
Feb 16, 2012, 8:56:06 PM (7 years ago)
Author:
ksherdy
Message:

Fixed allocation bug in standard allocation method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/allocator.hpp

    r1842 r1935  
    1212
    1313#include "debug.hpp"
     14#include "bitblock.hpp"
    1415#include <assert.h>
    1516#include <stdint.h>
     
    5455
    5556        void * allocate(uint64_t n, uint64_t & allocd_segment_size) {
     57
    5658                if(n > available) {
    5759                        segment_size = next_segment_size(n);
     
    7072
    7173                        available = segment_size;
     74                        n = segment_size;
    7275
    7376                        next->next = NULL;
     
    8487                return (void *) (address);
    8588        }
     89/*
     90        void * allocate_aligned(uint64_t n, uint64_t & allocd_segment_size) {
    8691
    87         void * allocate_aligned(uint64_t n, uint64_t & allocd_segment_size) {
    8892                uint64_t n_padded = (n+ALIGNMENT-1);
    8993
     
    105109
    106110                        available = segment_size;
     111                        //n = segment_size;
    107112
    108113                        next->next = NULL;
     
    122127                return (void *) (address + padding);
    123128        }
    124 
     129*/
    125130        void destroy() {
    126131                node * crt = head.next;
Note: See TracChangeset for help on using the changeset viewer.