Displaying 12 results from an estimated 12 matches for "sizet".
Did you mean:
size
2020 Sep 29
2
[PATCH libnbd] generator: Add SizeT type, maps to C size_t.
...generator/Python.ml | 11 +++++++++--
6 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/generator/API.ml b/generator/API.ml
index 0a876c4..b93580d 100644
--- a/generator/API.ml
+++ b/generator/API.ml
@@ -47,6 +47,7 @@ and arg =
| Int of string
| Int64 of string
| Path of string
+| SizeT of string
| SockAddrAndLen of string * string
| String of string
| StringList of string
diff --git a/generator/API.mli b/generator/API.mli
index 9d2fdb7..2e7aa78 100644
--- a/generator/API.mli
+++ b/generator/API.mli
@@ -57,6 +57,7 @@ and arg =
| Int of string (** small int *)
| Int...
2020 Oct 01
0
Re: [PATCH libnbd] generator: Add SizeT type, maps to C size_t.
...ator/API.mli | 1 +
> generator/C.ml | 14 ++++++++++----
> generator/GoLang.ml | 5 +++++
> generator/OCaml.ml | 5 +++++
> generator/Python.ml | 11 +++++++++--
> 6 files changed, 31 insertions(+), 6 deletions(-)
Looks good, and I'll push a counterpart patch adding RSizeT for
returning ssize_t values.
Question: Should nbd_opt_list() return RSizeT instead of RInt, as it is
returning a count of times the callback was called? The same question
would apply to my upcoming nbd_opt_list_meta_context(). Changing a
return type from 'int' to 'ssize_t' can re...
2020 Sep 29
2
Re: [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
...t; + default_call with
> + args = [ Int "i" ]; ret = RString;
Previously we have only used the Int parameter type for things which
are plausibly integers (timeouts, signal numbers). This one really
ought to be an unsigned or better still a size_t. Would it help if I
provided a SizeT type for the generator?
But in general yes this patch is obvious so ACK.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot w...
2009 Feb 18
0
[LLVMdev] Parametric polymorphism
...;
> The generated code for getSecond() needs to know the size of T in
> order to calculate the correct offset into the record. However,
> we still don't need to generate a bazillion specialized copies;
> we can simply pass the size of T as an argument:
>
> void getSecond(int sizeT, void* pair, void* result) {
> return memcpy(result, ((char*) pair) + sizeT, sizeT);
> }
>
Of course, that only works for POD types, so you still need a
different instantiation for std::string, std::vector, ...
There's no possibility of implementing C++'s complicated lookup a...
2009 Feb 18
2
[LLVMdev] Parametric polymorphism
> I think the problem is deeper than that, in that LLVM has no official
> concept of a subtype, so I don't see how the idea of polymorphism
> could be defined in it.
Parametric polymorphism is different from subtype polymorphism; you
can have one without the other. Parametric polymorphism just means
that you can use type variables (like T) in the IR, which are later
instantiated
to
2009 Feb 18
2
[LLVMdev] Parametric polymorphism
...f why it's needed in the host language, as is overloading.
There's no reason why specialization -has- to be done by llvm.
Idiotic languages like C++ can do it themselves, badly, if they want. ;-)
I want llvm to do it for me because it can do a better job. ;-)
>> void getSecond(int sizeT, void* pair, void* result) {
>> return memcpy(result, ((char*) pair) + sizeT, sizeT);
>> }
>
> Of course, that only works for POD types, so you still need a
> different instantiation for std::string, std::vector, ...
Every llvm type is a POD type. It's either a scalar...
2020 Sep 29
0
Re: [libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
...;> + args = [ Int "i" ]; ret = RString;
>
> Previously we have only used the Int parameter type for things which
> are plausibly integers (timeouts, signal numbers). This one really
> ought to be an unsigned or better still a size_t. Would it help if I
> provided a SizeT type for the generator?
If we take SizeT as parameter for this one, we probably want to return
an ssize_t for get_nr_meta_contexts, rather than RInt. Does the name
RSizeT that returns ssize_t make sense?
>
> But in general yes this patch is obvious so ACK.
>
> Rich.
>
--
Er...
2009 Feb 18
2
[LLVMdev] Parametric polymorphism
...e exact same generated code.
The generated code for getSecond() needs to know the size of T in
order to calculate the correct offset into the record. However,
we still don't need to generate a bazillion specialized copies;
we can simply pass the size of T as an argument:
void getSecond(int sizeT, void* pair, void* result) {
return memcpy(result, ((char*) pair) + sizeT, sizeT);
}
Transformations of this kind are most definitely not high-level.
In order to avoid code bloat, I have been forced to completely
bypass the llvm type system. Llvm is supposed to take care of
determining offs...
2005 Apr 21
1
Fwd: (KAME-snap 9012) racoon in the kame project
FYI, looks like support for Racoon is ending. Does anyone have any
experience with the version in ipsec-tools ?
---Mike
>Racoon users,
>
>This is the announcement that the kame project will quit providing
>a key management daemon, the racoon, and that "ipsec-tools" will become
>the formal team to release the racoon.
>The final release of the racoon in the
2008 Oct 11
6
size_t and printk and Xen
...code in Xen that printk''s a size_t and find that
I can''t write code (short of ifdef''ing) that compiles on
both 32-bit and 64-bit because size_t is typedef''d in Xen as an
unsigned long. C.f.
http://www.velocityreviews.com/forums/t438359-portable-way-to-printf-a-sizet-instance.html
It appears that the %z format is understood by Xen printk.
Is the typedef historical and should be removed? Or is it
necessary for some (older?) compilers?
If it is not going to be removed, is there a workaround
(other than ifdef''ing)?
Thanks,
Dan
______________________...
2020 Sep 29
0
[PATCH libnbd] DO NOT PUSH: Update api: Add get_nr_meta_contexts, clear_meta_contexts
...PI.ml
index 770f41e..fd6f033 100644
--- a/generator/API.ml
+++ b/generator/API.ml
@@ -1024,7 +1024,7 @@ what it actually supports, see L<nbd_can_meta_context(3)>.";
"get_meta_context", {
default_call with
- args = [ Int "i" ]; ret = RString;
+ args = [ SizeT "i" ]; ret = RString;
shortdesc = "return the i'th meta context request";
longdesc = "\
During connection libnbd can negotiate zero or more metadata
diff --git a/lib/handle.c b/lib/handle.c
index e0047b7..7adc6d1 100644
--- a/lib/handle.c
+++ b/lib/handle.c
@...
2020 Sep 28
8
[libnbd PATCH 0/3] opt_list_meta_context
I'm posting this now, as I'm at the end of a workday and I got things
working for manual experimentation.
Still to do:
- write interop tests for qemu-nbd and nbdkit (including my proposed
patch addition of qemu-nbd -A to show qemu:allocation-depth)
- figure out if we can make 'nbdinfo --map' use the new API to
automatically select all contexts advertised by the server
Eric Blake