search for: test_malloc

Displaying 5 results from an estimated 5 matches for "test_malloc".

2010 Jan 14
1
[LLVMdev] Cross-module function inlining
...is fine. It's very frustrating to look at C and assembly when the problem is in the IR -> IR transform itself. I've attached the relevant IR (stripped down to the bare minimum). The following commands will reproduce the problem (using vanilla 2.6 versions of the LLVM tools): llvm-as test_malloc.ll -o - | opt -std-link-opts -o - | llvm-dis -o - That strips everything except for @main. The stripping of the two global variables is fine, and there are no references to them left in the IR. But there are live references to @malloc and @free. The minimum options required for this behaviour are...
2017 Apr 30
2
allocsize: change from 3.9 to 4.0
Hi all, I added support for the allocsize function attribute to our compiler (LDC), thinking that that would enable removal of function calls when the allocated memory is not used. For example: ``` declare i8* @my_malloc(i32) allocsize(0) define void @test_malloc() { %1 = call i8* @my_malloc(i32 100) ret void } ``` I thought the my_alloc call in test_malloc would be removed, but `opt -O3` doesn't do that (LLVM 4.0 and trunk). However, LLVM3.9's `opt` _does_ remove the call. I can't find out why this was changed. (if the call is to "mal...
2012 Oct 11
1
memory allocation in new thread
Hi! I have some problems with memory allocation. I create new thread in cidir storage and call malloc(), and it fails to allocate even 1 byte. What can cause this problem? Dovecot vesrion is: 2.1.10 (130563b592c9+) Sample code looks like this (I also link to pthread with: -pthread): #define TEST_MALLOC() \ { \ ??? void *p; \ ??? p = malloc(1); \ ??? if (!p) { \ ??? ??? i_info("%s: malloc() failed", __FUNCTION__); \ ??? } else { \ ??? ??? i_info("%s: malloc() succeeded", __FUNCTION__); \ ??? ??? free(p); \ ??? } \ } #include <pthread.h> static void *test_pthread_...
2010 Jan 14
0
[LLVMdev] Cross-module function inlining
Mark Muir wrote: > > On 13 Jan 2010, at 20:34, Nick Lewycky wrote: > >> On 13 January 2010 12:05, Mark Muir <mark.i.r.muir at gmail.com >> <mailto:mark.i.r.muir at gmail.com>> wrote: >> >> >> But... now there's a small problem with library calls. Symbols >> such as 'memset', 'malloc', etc. are being removed by
2010 Jan 13
2
[LLVMdev] Cross-module function inlining
On 13 Jan 2010, at 20:34, Nick Lewycky wrote: > On 13 January 2010 12:05, Mark Muir <mark.i.r.muir at gmail.com> wrote: > > But... now there's a small problem with library calls. Symbols such as 'memset', 'malloc', etc. are being removed by global dead code elimination. They are implemented in one of the bitcode modules that are linked together (implementations