search for: newptr

Displaying 20 results from an estimated 22 matches for "newptr".

2020 Apr 15
1
Re: [PATCH nbdkit 1/9] common: Add a generic implementation of vectors.
...0, .alloc = 0 } Nice that this initializer is type-agnostic. > + > +struct generic_vector { > + void *ptr; > + size_t size; > + size_t alloc; > +}; > + > +static int > +generic_vector_extend (struct generic_vector *v, size_t n, size_t itemsize) > +{ > + void *newptr; > + > + newptr = realloc (v->ptr, (n + v->alloc) * itemsize); > + if (newptr == NULL) > + return -1; > + v->ptr = newptr; > + v->alloc += n; > + return 0; > +} Do we really want this implemented in the header? -- Eric Blake, Principal Software Enginee...
2020 Apr 15
0
[PATCH nbdkit 1/9] common: Add a generic implementation of vectors.
...\ + } + +#define empty_vector { .ptr = NULL, .size = 0, .alloc = 0 } + +struct generic_vector { + void *ptr; + size_t size; + size_t alloc; +}; + +static int +generic_vector_extend (struct generic_vector *v, size_t n, size_t itemsize) +{ + void *newptr; + + newptr = realloc (v->ptr, (n + v->alloc) * itemsize); + if (newptr == NULL) + return -1; + v->ptr = newptr; + v->alloc += n; + return 0; +} + +#endif /* NBDKIT_VECTOR_H */ diff --git a/.gitignore b/.gitignore index c44fb40d..8974b64f 100644 --- a/.gitignore +++ b/.gitignore...
2016 Feb 12
2
Memory Store/Load Optimization Issue (Emulating stack)
Hi again, So I finally gave up on trying to get through the converting (x86' push pop mov add) because it deals a lot with crazy pointer arithmetics and sonce inttoptr and ptrtoint doesn't provide any alias analysis information. Daniel, you said it doesn't make much sense to provide it but in my cases it is actually very much needed, you didn't say it wasn't possible to
2020 Oct 27
0
[PATCH libnbd 1/5] common/utils: Copy simple vector library from nbdkit.
...THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <config.h> + +#include <stdio.h> +#include <stdlib.h> + +#include "vector.h" + +int +generic_vector_reserve (struct generic_vector *v, size_t n, size_t itemsize) +{ + void *newptr; + + newptr = realloc (v->ptr, (n + v->alloc) * itemsize); + if (newptr == NULL) + return -1; + v->ptr = newptr; + v->alloc += n; + return 0; +} diff --git a/common/utils/vector.h b/common/utils/vector.h new file mode 100644 index 0000000..6468fd9 --- /dev/null +++ b/common/util...
2023 Mar 01
6
[libnbd PATCH 0/6] common: catch up with nbdkit
If we compare the "common" subdirectory between nbdkit @ 6b4178d0fdfe ("ci: Temporarily disable perl in MacOS", 2023-02-27) and libnbd @ d05cd8f384a7 ("Version 1.15.11.", 2023-02-28), we find differences. We can categorize these differences along two (orthogonal) axes: - Intentional or unintentional. Intentional differences are for example when one of the libnbd
2020 Mar 12
0
[PATCH libguestfs 1/3] daemon: xattr: Refactor code which splits attr names from the kernel.
...estfs_int_xattr_list * do_internal_lxattrlist (const char *path, char *const *names) { guestfs_int_xattr_list *ret = NULL; - size_t i, j; + size_t i; size_t k, m, nr_attrs; ssize_t len, vlen; @@ -293,6 +322,7 @@ do_internal_lxattrlist (const char *path, char *const *names) void *newptr; CLEANUP_FREE char *pathname = NULL; CLEANUP_FREE char *buf = NULL; + CLEANUP_FREE_STRING_LIST char **attrnames = NULL; /* Be careful in this loop about which errors cause the whole call * to abort, and which errors allow us to continue processing @@ -350,12 +380,10 @@ do_...
2020 Mar 16
0
[PATCH libguestfs v2 1/3] daemon: xattr: Refactor code which splits attr names from the kernel.
...estfs_int_xattr_list * do_internal_lxattrlist (const char *path, char *const *names) { guestfs_int_xattr_list *ret = NULL; - size_t i, j; + size_t i; size_t k, m, nr_attrs; ssize_t len, vlen; @@ -293,6 +319,7 @@ do_internal_lxattrlist (const char *path, char *const *names) void *newptr; CLEANUP_FREE char *pathname = NULL; CLEANUP_FREE char *buf = NULL; + CLEANUP_FREE /* not string list */ char **attrnames = NULL; /* Be careful in this loop about which errors cause the whole call * to abort, and which errors allow us to continue processing @@ -350,12 +377...
2020 Mar 16
6
[PATCH libguestfs v2 0/3] daemon: Fix various commands which break on NTFS-3g compressed files.
v1 here: https://www.redhat.com/archives/libguestfs/2020-March/msg00099.html This one fixes most of the points picked up in review, and does not strdup the strings which should keep down memory usage if that is a concern. Rich.
2020 Mar 12
8
[PATCH libguestfs 0/3] daemon: Fix various commands which break on NTFS-3g compressed files.
https://bugzilla.redhat.com/show_bug.cgi?id=1811539 Commands including virt-diff which read extended attributes will sometimes fail on NTFS filesystems that are using system compressed. The reason is complex, see comment 5 of the bug linked above. This patch filters out the troublesome xattr. For justification, see the comment I added in patch 3. Patch 1 & 2 are refactoring. I was on the
2003 May 24
1
ipfirewall(4)) cannot be changed
root@vigilante /root cuaa1# man init |tail -n 130 |head -n 5 3 Network secure mode - same as highly secure mode, plus IP packet filter rules (see ipfw(8) and ipfirewall(4)) cannot be changed and dummynet(4) configuration cannot be adjusted. root@vigilante /root cuaa1# sysctl -a |grep secure kern.securelevel: 3 root@vigilante /root cuaa1# ipfw show 00100 0 0 allow
2020 Apr 15
18
[PATCH nbdkit 0/9] Generic vector, and pass $nbdkit_stdio_safe to shell scripts.
This was a rather longer trip around the houses than I anticipated! The basic purpose of the patch series is to set $nbdkit_stdio_safe to "0" or "1" in sh and eval plugin scripts. To do that, I ended up adding a nicer way to manipulate environ lists, and to do that, I ended up adding a whole generic vector implementation which is applicable in a lot of different places.
2020 Mar 16
0
[PATCH libguestfs v2 3/3] daemon: xattr: Filter out user.WofCompressedData from xattrs (RHBZ#1811539).
...n); + names_unfiltered = split_attr_names (buf, len); + if (names_unfiltered == NULL) + goto error; + names = filter_list (not_hidden_xattr, names_unfiltered); if (names == NULL) goto error; @@ -319,6 +348,7 @@ do_internal_lxattrlist (const char *path, char *const *names) void *newptr; CLEANUP_FREE char *pathname = NULL; CLEANUP_FREE char *buf = NULL; + CLEANUP_FREE /* not string list */ char **attrnames_unfiltered = NULL; CLEANUP_FREE /* not string list */ char **attrnames = NULL; /* Be careful in this loop about which errors cause the whole call @@ -37...
2013 May 18
2
Latest firmware branch failing to compile with gnu-efi-3.0t
...malloc_tag_t tag) ^ /home/voltagex/src/syslinux/efi/mem.c: In function 'efi_realloc': /home/voltagex/src/syslinux/efi/mem.c:14:2: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration] memcpy(newptr, ptr, size); ^ make[3]: *** [mem.o] Error 1 make[3]: Leaving directory `/home/voltagex/src/syslinux/efi64/efi' make[2]: *** [efi] Error 2 make[2]: Leaving directory `/home/voltagex/src/syslinux/efi64' make[1]: *** [efi64] Error 2 make[1]: Leaving directory `/home/voltagex/src/syslinux'...
2007 Feb 13
0
libswfdec/jpeg libswfdec/swfdec_image.c
...648,11 @@ jpeg_decoder_decode_entropy_segment (Jpe } len++; } - JPEG_DEBUG ("entropy length = %d", len); + OIL_DEBUG ("entropy length = %d", len); /* we allocate extra space, since the getbits() code can * potentially read past the end of the buffer */ - newptr = g_malloc (len + 2); + newptr = malloc (len + 2); for (i = 0; i < len; i++) { newptr[j] = bits->ptr[i]; j++; @@ -697,9 +672,8 @@ jpeg_decoder_decode_entropy_segment (Jpe x = dec->x; y = dec->y; n = dec->restart_interval; - if (n == 0) - n = G_MAXINT; - wh...
2007 Apr 18
0
6 commits - libswfdec-gtk/swfdec_gtk_widget.c libswfdec/jpeg libswfdec/swfdec_image.c
...fix security problem with overreading available data diff --git a/libswfdec/jpeg/jpeg.c b/libswfdec/jpeg/jpeg.c index 0c648c2..62aa499 100644 --- a/libswfdec/jpeg/jpeg.c +++ b/libswfdec/jpeg/jpeg.c @@ -381,6 +381,7 @@ jpeg_decoder_decode_entropy_segment (Jpe short block2[64]; unsigned char *newptr; int len; + int maxlen; int j; int i; int go; @@ -389,11 +390,11 @@ jpeg_decoder_decode_entropy_segment (Jpe int ret; len = 0; + maxlen = jpeg_bits_available (bits) - 1; j = 0; - while (1) { - if (bits->ptr[len] == 0xff && bits->ptr[len + 1] != 0x00) { +...
2020 Oct 27
6
[PATCH libnbd 0/5] info: --map: Coalesce adjacent extents of the same type.
This adds coalescing of adjacent extents of the same type, as mentioned by Eric Blake in the commit message here: https://github.com/libguestfs/libnbd/commit/46072f6611f80245846a445766da071e457b00cd The patch series is rather long because it detours through adding the <vector.h> library from nbdkit into libnbd and replacing ad hoc uses of realloc, char ** etc in various places. Rich.
2004 Aug 06
7
question on downsampling
Hi, Maybe a bit off topic for this list, bt anyway. I have received several feature requests for DarkIce to support downsampling of the audio input before passing it to lame or ogg vorbis. For example the audio read from the soundcard would be 44.1kHz, and lame would get it at 22.05kHz. I figure two ways of doing this: 1. For lame, one can specify the input and the desired mp3 sampling rate,
2009 Feb 22
2
The machdep.hyperthreading_allowed & ULE weirdness in 7.1
Hi Jeff, I have a single-CPU system with P4 HTT-enabled processor (7.1-RELEASE-p3), kernel compiled with SCHED_ULE. Copyright (c) 1992-2009 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 7.1-RELEASE-p3 #0:
2006 Nov 17
1
gjournal on 6.x wont build
Hi all, I was intending on trying out gjournal on a new disk i've added in my desktop. I had a look to see what the most recent patch provided by Pawel and found http://people.freebsd.org/~pjd/patches/gjournal6_20061024.patch I created the directories as per Pawel's original post (http://lists.freebsd.org/pipermail/freebsd-fs/2006-June/001962.html) and the patch succeeded with no failed
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but separating them is a lot of work. With *both* patches applied, all the tests and extra-tests pass. That's no guarantee however that there isn't a mistake, so I don't think this patch is a candidate for the 1.16 branch, until it's had a lot more testing in development. Rich.