utils/bench-object.cc
changeset 732 df256f32b6ae
parent 710 2a9c061219a7
child 2230 9f13ac3291e0
equal deleted inserted replaced
731:c37436811d6f 732:df256f32b6ae
    26   int nswaps = atoi (argv[2]);
    26   int nswaps = atoi (argv[2]);
    27 
    27 
    28   std::vector< Ptr<BaseA> > objlist;
    28   std::vector< Ptr<BaseA> > objlist;
    29 
    29 
    30   for (int i = 0; i < nobjects; ++i)
    30   for (int i = 0; i < nobjects; ++i)
    31     objlist.push_back (MakeNewObject<BaseA> ());
    31     objlist.push_back (Create<BaseA> ());
    32 
    32 
    33   for (int swapCounter = nswaps; swapCounter; --swapCounter)
    33   for (int swapCounter = nswaps; swapCounter; --swapCounter)
    34     {
    34     {
    35       int x1 = swapCounter % nobjects;
    35       int x1 = swapCounter % nobjects;
    36       int x2 = (swapCounter+1) % nobjects;
    36       int x2 = (swapCounter+1) % nobjects;