Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(800)

Side by Side Diff: third_party/tcmalloc/chromium/src/tests/thread_dealloc_unittest.cc

Issue 9666033: Experiment for updating the tcmalloc chromium branch to r144 (gperftools 2.0). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2004, Google Inc. 1 // Copyright (c) 2004, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 // Author: Sanjay Ghemawat 31 // Author: Sanjay Ghemawat
32 // 32 //
33 // Check that we do not leak memory when cycling through lots of threads. 33 // Check that we do not leak memory when cycling through lots of threads.
34 34
35 #include "config_for_unittests.h" 35 #include "config_for_unittests.h"
36 #include <stdio.h> 36 #include <stdio.h>
37 #ifdef HAVE_UNISTD_H 37 #ifdef HAVE_UNISTD_H
38 #include <unistd.h> // for sleep() 38 #include <unistd.h> // for sleep()
39 #endif 39 #endif
40 #include "base/logging.h" 40 #include "base/logging.h"
41 #include <google/malloc_extension.h> 41 #include <gperftools/malloc_extension.h>
42 #include "tests/testutil.h" // for RunThread() 42 #include "tests/testutil.h" // for RunThread()
43 43
44 // Size/number of objects to allocate per thread (1 MB per thread) 44 // Size/number of objects to allocate per thread (1 MB per thread)
45 static const int kObjectSize = 1024; 45 static const int kObjectSize = 1024;
46 static const int kNumObjects = 1024; 46 static const int kNumObjects = 1024;
47 47
48 // Number of threads to create and destroy 48 // Number of threads to create and destroy
49 static const int kNumThreads = 1000; 49 static const int kNumThreads = 1000;
50 50
51 // Allocate lots of stuff 51 // Allocate lots of stuff
(...skipping 22 matching lines...) Expand all
74 } 74 }
75 } 75 }
76 delete[] display; 76 delete[] display;
77 77
78 printf("PASS\n"); 78 printf("PASS\n");
79 #ifdef HAVE_UNISTD_H 79 #ifdef HAVE_UNISTD_H
80 sleep(1); // Prevent exit race problem with glibc 80 sleep(1); // Prevent exit race problem with glibc
81 #endif 81 #endif
82 return 0; 82 return 0;
83 } 83 }
OLDNEW
« no previous file with comments | « third_party/tcmalloc/chromium/src/tests/tcmalloc_unittest.cc ('k') | third_party/tcmalloc/chromium/src/thread_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698