search for: myalloc

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

Did you mean: malloc
2014 Oct 22
2
Using a custom memory allocation function in R
...or3 directly at the R level? I assume I have to go through the R-C interface. As far as I know, I cannot just return a pointer to the allocated area, but have to pass the result as an argument. So in R I call something like n <- length(Y) res <- numeric(length=1) .Call("R_allocate_using_myalloc", n, res) res <- Y - mean(Y) and in C #include <R.h> #include <Rinternals.h> #include <numa.h> SEXP R_allocate_using_myalloc(SEXP R_n, SEXP R_res){ PROTECT(R_n = coerceVector(R_n, INTSXP)); PROTECT(R_res = coerceVector(R_res, REALSXP)); int *restrict n = INTEGER(...
2013 Sep 12
10
[PATCH] xen/build: Remove hacked up version of figlet
...ws; - int fd,result; - - if ((fd = open("/dev/tty",O_WRONLY))<0) return -1; - result = ioctl(fd,TIOCGWINSZ,&ws); - close(fd); - return result?-1:ws.ws_col; -} -#endif /* ifdef TIOCGWINSZ */ - - -/**************************************************************************** - - myalloc - - Calls malloc. If malloc returns error, prints error message and - quits. - -****************************************************************************/ - -#ifdef __STDC__ -char *myalloc(size_t size) -#else -char *myalloc(size) -int size; -#endif -{ - char *ptr; -#ifndef __STDC__ - extern...
2006 Oct 24
15
How to emit associative array after ^C
Boy am I a dummy. I want to simply dump out unfreed allocations when I terminate the script. What''s the secret sauce? #!/usr/sbin/dtrace -s pid$1::MyAlloc:return { bufs[arg1] = walltimestamp; } pid$1::MyFree:entry /bufs[arg0]/ { bufs[arg0] = 0; } This message posted from opensolaris.org
2016 Apr 02
2
getSymbolAddressInProcess returning null
Tried that, still didn't work. Then I tried making a direct API call, GetProcAddress(GetModuleHandle(0),"foo") And this works if and only if __declspec(dllexport) is supplied. So it looks like we were both right. On Sat, Apr 2, 2016 at 9:29 AM, NAKAMURA Takumi <geek4civic at gmail.com> wrote: > Have you tried to add dllexport? > > On Sat, Apr 2, 2016 at 4:23 PM
2016 Jul 21
2
RFC: LLVM Coroutine Representation, Round 2
.... >> >> entry: >> %elide = call i8* @llvm.coro.alloc() >> %0 = icmp ne i8* %elide, null >> br i1 %0, label %coro.begin, label %coro.alloc >> >> coro.alloc: >> %frame.size = call i32 @llvm.coro.size() >> %alloc = call i8* @MyAlloc(i32 %frame.size) >> br label %coro.begin >> >> coro.begin: >> %phi = phi i8* [ %elide, %entry ], [ %alloc, %coro.alloc ] >> %frame = call i8* @llvm.coro.begin(i8* %phi, i32 0, i8* null, i8* >> null) >> >> When using a static alloca for c...