search for: allocsize

Displaying 20 results from an estimated 43 matches for "allocsize".

Did you mean: alloc_size
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_a...
2015 Aug 26
5
[PATCH] Call ExitBootServices twice
From: Sylvain Gault <sylvain.gault at gmail.com> On some architecture, including my hardware, the function ExitBootServices may need to be called twice in order to successfully exit the boot services. As stated by the UEFI spec, the first call to ExitBootServices may perform a partial shutdown of the services. It seems that during this partial shutdown, the memory map can be modified, thus
2020 Apr 15
2
question on the signature of malloc
Hi all, consider the following function from Core.cpp in LLVM 9.0.0: LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name) { Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext()); Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy); Instruction* Malloc = CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(), ITy, unwrap(Ty), AllocSize,...
2015 Nov 02
3
[PATCH] efi: Call ExitBootServices at least twice
...return 0; > } > > +/* > + * Like get_memory_map but try to use the given buffer first, reallocate it if > + * it's too small and always set the allocated size. > + */ > +static EFI_MEMORY_DESCRIPTOR * > +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, > + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, > + UINT32 *desc_ver) > +{ > + EFI_STATUS status; > + UINTN size, allocsizeadd; > + > + allocsizeadd = sizeof(*map) * 2; > + > + do { > +...
2015 Sep 16
1
[PATCH] efi: Call ExitBootServices at least twice
..., return 0; > } > > +/* > + * Like get_memory_map but try to use the given buffer first, > reallocate it if > + * it's too small and always set the allocated size. > + */ > +static EFI_MEMORY_DESCRIPTOR * > +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, > + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, > + UINT32 *desc_ver) > +{ > + EFI_STATUS status; > + UINTN size, allocsizeadd; > + > + allocsizeadd = sizeof(*map) * 2; > + > + do { > + size = *allocsize; > + status = uefi_call_wrapper(BS->G...
2015 Aug 26
0
[PATCH] efi: Call ExitBootServices at least twice
...nt handle_ramdisks(struct linux_header *hdr, return 0; } +/* + * Like get_memory_map but try to use the given buffer first, reallocate it if + * it's too small and always set the allocated size. + */ +static EFI_MEMORY_DESCRIPTOR * +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, + UINT32 *desc_ver) +{ + EFI_STATUS status; + UINTN size, allocsizeadd; + + allocsizeadd = sizeof(*map) * 2; + + do { + size = *allocsize; + status = uefi_call_wrapper(BS->GetMemoryMap, 5, &size, map, key, +...
2015 Nov 03
2
[PATCH] efi: Call ExitBootServices at least twice
...+ * Like get_memory_map but try to use the given buffer first, reallocate >>> it if >>> + * it's too small and always set the allocated size. >>> + */ >>> +static EFI_MEMORY_DESCRIPTOR * >>> +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, >>> + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, >>> + UINT32 *desc_ver) >>> +{ >>> + EFI_STATUS status; >>> + UINTN size, allocsizeadd; >>> + >>> + allocsizeadd = sizeof(...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...gt;> +/* >> + * Like get_memory_map but try to use the given buffer first, reallocate >> it if >> + * it's too small and always set the allocated size. >> + */ >> +static EFI_MEMORY_DESCRIPTOR * >> +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, >> + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, >> + UINT32 *desc_ver) >> +{ >> + EFI_STATUS status; >> + UINTN size, allocsizeadd; >> + >> + allocsizeadd = sizeof(*map) * 2; >> + >&g...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...se the given buffer first, >>>> reallocate >>>> it if >>>> + * it's too small and always set the allocated size. >>>> + */ >>>> +static EFI_MEMORY_DESCRIPTOR * >>>> +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, >>>> + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, >>>> + UINT32 *desc_ver) >>>> +{ >>>> + EFI_STATUS status; >>>> + UINTN size, allocsizeadd; >>>> + >>>> +...
2015 May 14
1
[PATCH] When calling getline first time, initialize length to zero.
...hanged, 5 insertions(+), 5 deletions(-) diff --git a/df/estimate-max-threads.c b/df/estimate-max-threads.c index 7d5b090..ca1fd42 100644 --- a/df/estimate-max-threads.c +++ b/df/estimate-max-threads.c @@ -60,7 +60,7 @@ read_line_from (const char *cmd) { FILE *pp; char *ret = NULL; - size_t allocsize; + size_t allocsize = 0; pp = popen (cmd, "r"); if (pp == NULL) diff --git a/examples/libvirt-auth.c b/examples/libvirt-auth.c index 699dd87..8a5db77 100644 --- a/examples/libvirt-auth.c +++ b/examples/libvirt-auth.c @@ -109,7 +109,7 @@ auth_callback (guestfs_h *g, size_t i;...
2017 Sep 12
0
[PATCH v2 3/5] lib: qemu: Run QMP ‘query-commands’, ‘query-qmp-schema’ against the qemu binary.
...eneric_qmp_test (guestfs_h *g, struct qemu_data *data, + const char *qmp_command, + char **outp) +{ + CLEANUP_CMD_CLOSE struct command *cmd = guestfs_int_new_command (g); + int r, fd; + CLEANUP_FCLOSE FILE *fp = NULL; + CLEANUP_FREE char *line = NULL; + size_t allocsize = 0; + ssize_t len; + + guestfs_int_cmd_add_string_unquoted (cmd, "echo "); + /* QMP is modal. You have to send the qmp_capabilities command first. */ + guestfs_int_cmd_add_string_unquoted (cmd, "'{ \"execute\": \"qmp_capabilities\" }' "); + gue...
2012 May 03
1
File size diff on local disk vs NFS share
On May 3, 2012, at 3:04 PM, Glenn Cooper wrote: >>>> I never really paid attention to this but a file on an NFS mount is >>>> showing 64M in size, but when copying the file to a local drive, it >>>> shows 2.5MB in size. >>>> >>>> My NFS server is hardware Raided with a volume stripe size of 128K >>>> were the volume size is
2012 Nov 06
2
I am very confused about strip Stripe what way it hold space?
I have 4 dell 2970 server , three server harddisk is 146Gx6 ,one hard disk is 72Gx6: each server mount info is /dev/sda4 on /exp1 type xfs (rw) /dev/sdb1 on /exp2 type xfs (rw) /dev/sdc1 on /exp3 type xfs (rw) /dev/sdd1 on /exp4 type xfs (rw) /dev/sde1 on /exp5 type xfs (rw) /dev/sdf1 on /exp6 type xfs (rw) I create a gluster volume have 4 stripe gluster volume create test-volume3 stripe 4
2015 Jan 27
2
[LLVMdev] Create a call to function malloc using LLVM API
...int *) malloc(sizeof(*p)); Try to generate LLVM IR for it: Type *tp = p->getType(); AllocaInst* arg_alloc = builder.CreateAlloca(tp);//builder is IRBuilder if(tp->isPointerTy()){ Type* tpp = tp->getPointerElementType(); Type* ITy = Type::getInt32Ty(getGlobalContext()); Constant* AllocSize = ConstantExpr::getSizeOf(tpp) AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy); CallInst::CreateMalloc(arg_alloc, ITy, tpp, AllocSize); } But the generated LLVM IR seems incorrect: %malloccall = tail call i8* bitcast (i8* (i64)* @malloc to i8* (i32)*)(i32 ptrtoint (i32* getelement...
2016 May 21
1
[PATCH] umask: Use /proc/<PID>/status to read umask in Linux >= 4.7.
...<-1>. However if we could not open the + * F</proc> file or find the C<Umask> entry in it, return C<-2> which + * causes the fallback path to run. + */ +static int +get_umask_from_proc (guestfs_h *g) +{ + FILE *fp; + CLEANUP_FREE char *path = NULL, *line = NULL; + size_t allocsize; + ssize_t len; + unsigned int mask; + bool found = false; + + path = safe_asprintf (g, "/proc/%d/status", getpid ()); + fp = fopen (path, "r"); + if (fp == NULL) { + if (errno == ENOENT || errno == ENOTDIR) + return -2; /* fallback */ + perrorf (...
2013 Jan 02
0
[LLVMdev] [DragonEgg] [Polly] Should we expect DragonEgg to produce identical LLVM IR for identical GIMPLE?
...rValue = 47247802368 offset = 16, value = 64 offset = 20, value = 64 offset = 24, value = 64 MemoryAccess to pointer: float* inttoptr (i64 47246749696 to float*) { Stmt__12_cloned_[i0, i1, i2] -> MemRef_nttoptr (i64 47246749696 to float*)[4096i0 + 64i1 + i2] } allocSize: 4 storeSize: 4 replacedBy: { Stmt__12_cloned_[i0, i1, i2] -> NULL[o0] : o0 >= 47246749696 + 16384i0 + 256i1 + 4i2 and o0 <= 47246749699 + 16384i0 + 256i1 + 4i2 } MemoryAccess to pointer: float* inttoptr (i64 47247802368 to float*) { Stmt__12_cloned_[i0, i1, i2] -> MemRef_nttopt...
2013 Jan 02
2
[LLVMdev] [DragonEgg] [Polly] Should we expect DragonEgg to produce identical LLVM IR for identical GIMPLE?
On 01/01/2013 02:45 PM, Duncan Sands wrote: > Hi Dmitry, > >> >> In our compiler we use a modified version LLVM Polly, which is very >> sensitive to >> proper code generation. Among the number of limitations, the loop region >> (enclosed by phi node on induction variable and branch) is required to >> be free >> of additional memory-dependent
2015 Nov 03
2
Representing X86 long double in Debug Info
Adrian Prantl via llvm-dev wrote on Mon, 02 Nov 2015: > Looking at the code in clang CGDebugInfo just passes through the > width of the type as it is described by the TypeInfo, which in turn > is defined by the Target. At the moment I do not understand why an > x86_fp80 is reported to be 128 bits wide. The x86-64 and Darwin/i386 ABI define the size of the 80 bits extended
2018 Feb 16
2
Missing attribute inference cases
...uill analysis and then merge nonnull inference to promote dereferenceable_or_null - see previous nounwind - currently implemented in PruneEH, missing in new pass manager -- this one will get fixed in the near future Other cases I just noticed... noreturn -- useful for exception throw wrappers allocsize -- useful for allocation wrappers writeonly -- useful for AA speculatable - useful for speculation, LICM, PRE, etc... Untrusted Declarations In several cases, we check hasExactDefinition before checking properties of the function declaration (such as return type). To my knowledge, facts on d...
2015 Sep 15
1
[PATCH] daemon: initrd: print return value from failing process
...initrd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/daemon/initrd.c b/daemon/initrd.c index ac14826..c9fc2dd 100644 --- a/daemon/initrd.c +++ b/daemon/initrd.c @@ -43,6 +43,7 @@ do_initrd_list (const char *path) CLEANUP_FREE char *filename = NULL; size_t allocsize; ssize_t len; + int ret; /* "zcat /sysroot/<path> | cpio --quiet -it", but path must be quoted. */ if (asprintf_nowarn (&cmd, "%s %R | %s --quiet -it", str_zcat, path, str_cpio) == -1) { @@ -74,8 +75,15 @@ do_initrd_list (const char *path) return NULL;...