From: Brian Norris Date: Mon, 8 Oct 2012 20:11:13 +0000 (-0700) Subject: mymemory: kill system_malloc() X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=249a155b1ad7a7d1b53c0810cd7c85d6f99af47e;p=cdsspec-compiler.git mymemory: kill system_malloc() Not needed --- diff --git a/mymemory.cc b/mymemory.cc index c076f54..cdfa372 100644 --- a/mymemory.cc +++ b/mymemory.cc @@ -88,24 +88,6 @@ void snapshot_free(void *ptr) free(ptr); } -void *system_malloc(size_t size) -{ - static void *(*mallocp)(size_t size); - char *error; - void *ptr; - - /* get address of libc malloc */ - if (!mallocp) { - mallocp = (void * (*)(size_t))dlsym(RTLD_NEXT, "malloc"); - if ((error = dlerror()) != NULL) { - fputs(error, stderr); - exit(EXIT_FAILURE); - } - } - ptr = mallocp(size); - return ptr; -} - /** Non-snapshotting free for our use. */ void model_free(void *ptr) { diff --git a/mymemory.h b/mymemory.h index 0e274d2..85679a1 100644 --- a/mymemory.h +++ b/mymemory.h @@ -49,8 +49,6 @@ void * snapshot_malloc(size_t size); void * snapshot_calloc(size_t count, size_t size); void snapshot_free(void *ptr); -void *system_malloc(size_t size ); - /** @brief Provides a non-snapshotting allocator for use in STL classes. * * The code was adapted from a code example from the book The C++