@needs_dlfcn
def test_dlfcn_mallocs(self):
    self.set_setting('INITIAL_MEMORY', ((64 * 1024) * 1024))
    self.prep_dlfcn_lib()
    lib_src = '\n      #include <assert.h>\n      #include <stdio.h>\n      #include <string.h>\n      #include <stdlib.h>\n\n      void *mallocproxy(int n) { return malloc(n); }\n      void freeproxy(void *p) { free(p); }\n      '
    self.set_setting('EXPORTED_FUNCTIONS', ['_mallocproxy', '_freeproxy'])
    dirname = self.get_dir()
    filename = os.path.join(dirname, 'liblib.c')
    self.build_dlfcn_lib(lib_src, dirname, filename)
    self.prep_dlfcn_main()
    src = open(path_from_root('tests', 'dlmalloc_proxy.c')).read()
    self.set_setting('EXPORTED_FUNCTIONS', ['_main', '_malloc', '_free'])
    self.do_run(src, '*294,153*', force_c=True)
@needs_dlfcn
def test_dlfcn_mallocs(self):
    self.set_setting('INITIAL_MEMORY', ((64 * 1024) * 1024))
    self.prep_dlfcn_lib()
    lib_src = '\n      #include <assert.h>\n      #include <stdio.h>\n      #include <string.h>\n      #include <stdlib.h>\n\n      void *mallocproxy(int n) { return malloc(n); }\n      void freeproxy(void *p) { free(p); }\n      '
    self.set_setting('EXPORTED_FUNCTIONS', ['_mallocproxy', '_freeproxy'])
    dirname = self.get_dir()
    filename = os.path.join(dirname, 'liblib.c')
    self.build_dlfcn_lib(lib_src, dirname, filename)
    self.prep_dlfcn_main()
    src = open(path_from_root('tests', 'dlmalloc_proxy.c')).read()
    self.set_setting('EXPORTED_FUNCTIONS', ['_main', '_malloc', '_free'])
    self.do_run(src, '*294,153*', force_c=True)