Fast Memory Allocation

by H. Thomas Richter



    

Listing One

struct t_heappolicy {

    unsigned long size;

    int flags;

    char key;

    int remove_now;

};



Listing Two

int main(int argv, char **argv)

{

#ifdef FMA

    t_heappolicy policy = { 1 << 20, 0, 1 };

#endif

    int *ip = new int;  // Create a private heap of 1 MB

    .....

#ifdef FMA

    policy.remove_now =  1;

#endif

    delete ip;

}



1



