search for: typesaf

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

Did you mean: typesafe
2020 Sep 06
0
[libnbd PATCH 2/3] golang: Typesafe returns for REnum/RFlags
Now that we have a distinct branch in the generator when returning an enum or bitmask that cannot fail, we can use it in Golang for symmetry, so that the result of a get function can be plugged into a set function without a trip through other types. --- generator/GoLang.ml | 12 ++++++------ .../libnbd/libnbd_110_defaults_test.go | 6 +++---
2008 Jan 18
2
[PATCH 2/3] Make IRQ handlers typesafe.
.../include/linux/interrupt.h Thu Jan 17 14:48:56 2008 +1100 +++ b/include/linux/interrupt.h Thu Jan 17 15:42:01 2008 +1100 @@ -69,13 +69,26 @@ struct irqaction { }; extern irqreturn_t no_action(int cpl, void *dev_id); -extern int __must_check request_irq(unsigned int, irq_handler_t handler, + +/* Typesafe version of request_irq. Also takes old-style void * handlers. */ +#define request_irq(irq, handler, flags, name, dev_id) \ + __request_irq((irq), \ + check_either_type((handler), irq_handler_t, \ + int (*)(int, typeof(dev_id))), \ + (flags), (name), (dev_id)) + +extern in...
2008 Jan 18
2
[PATCH 2/3] Make IRQ handlers typesafe.
.../include/linux/interrupt.h Thu Jan 17 14:48:56 2008 +1100 +++ b/include/linux/interrupt.h Thu Jan 17 15:42:01 2008 +1100 @@ -69,13 +69,26 @@ struct irqaction { }; extern irqreturn_t no_action(int cpl, void *dev_id); -extern int __must_check request_irq(unsigned int, irq_handler_t handler, + +/* Typesafe version of request_irq. Also takes old-style void * handlers. */ +#define request_irq(irq, handler, flags, name, dev_id) \ + __request_irq((irq), \ + check_either_type((handler), irq_handler_t, \ + int (*)(int, typeof(dev_id))), \ + (flags), (name), (dev_id)) + +extern in...
2020 Sep 06
0
[libnbd PATCH 3/3] ocaml: Typesafe returns for REnum/RFlags
Now that we have a distinct branch in the generator when returning an enum or bitmask that cannot fail, we can use it in OCaml for symmetry, so that the result of a get function can be plugged into a set function without manual conversion of an integer. While at it, add an abort() if OCaml ever hands us a value we can't translate to a C int (that one is unreachable per OCaml type safety), or
2020 Sep 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
Now that we have a distinct branch in the generator when returning an enum or bitmask that cannot fail, we can use it in OCaml for symmetry, so that the result of a get function can be plugged into a set function without manual conversion of an integer. This includes the use of the recently-added UNKNOWN catch-all for encoding C values returned by a newer libnbd.so than when the OCaml bindings
2008 Mar 15
3
[LLVMdev] improving the ocaml binding's type safety
So just to compare, here are two different typesafe phantom type implementations. One is bottom down, the other bottom up. This is an example of the following functions: string Value::getName() bool Constant::isNull() bool GlobalValue::isDeclaration() bool GlobalVariable::isGlobalConstant() bool Function::isVarArg() Driver code: val make_constan...
2020 Apr 03
4
[PATCH 40/44] drm/cirrus: Don't use drm_device->dev_private
Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Signed-off-by: Daniel Vetter <daniel.vetter at intel.com> Cc: Dave Airlie <airlied at redhat.com> Cc: Gerd Hoffmann <kraxel at redhat.com> Cc: Daniel Vetter <daniel.vetter at ffwll.ch> Cc: "Noralf Tr?nnes" <nora...
2020 Apr 03
4
[PATCH 40/44] drm/cirrus: Don't use drm_device->dev_private
Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Signed-off-by: Daniel Vetter <daniel.vetter at intel.com> Cc: Dave Airlie <airlied at redhat.com> Cc: Gerd Hoffmann <kraxel at redhat.com> Cc: Daniel Vetter <daniel.vetter at ffwll.ch> Cc: "Noralf Tr?nnes" <nora...
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...generally favorable on the core idea of having a type-safe and friendly format-string-like formatting utility I’m also generally in favour, but I wonder what the key motivations for designing our own, rather than importing something like FastFormat, fmtlib, or one of the other tried-and-tested C++ typesafe I/O libraries is. Has someone done an analysis of why these designs are a bad fit for LLVM, or are we just reinventing the wheel because we feel like it? David
2008 Mar 15
0
[LLVMdev] improving the ocaml binding's type safety
Hi Erick, On 2008-03-15, at 04:03, Erick Tryzelaar wrote: > I was talking to Gordon on #llvm earlier, and he challenged me with > coming up with a way to improve the ocaml binding's type safety. I > think I got an easy solution with phantom types. This could be a good step. I'm not sure I can predict all of the implications; I'd suggest you work up a proof of concept.
2020 Sep 07
0
Re: [libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
...'s conceivable this could be useful because OCaml bindings are generally statically linked into the final binary so you could get a newer libnbd.so.0 / old binary with old OCaml bindings scenario. Rich. > Eric Blake (3): > generator: Introduce REnum/RFlags return types > golang: Typesafe returns for REnum/RFlags > ocaml: Typesafe returns for REnum/RFlags > > generator/API.ml | 16 ++++-- > generator/API.mli | 2 + > generator/C.ml | 20 ++++--- > generator/GoLang.ml...
2004 Sep 05
0
[LLVMdev] POST MORTEM: llvm-test changes
...config.status: executing test/Programs/TEST.dsgraph.Makefile commands install: ../test/Programs/TEST.dsgraph.Makefile does not exist config.status: executing test/Programs/TEST.jit.report commands install: ../test/Programs/TEST.jit.report does not exist config.status: executing test/Programs/TEST.typesafe.Makefile commands install: ../test/Programs/TEST.typesafe.Makefile does not exist config.status: executing test/Programs/TEST.dsgraph.gnuplot commands install: ../test/Programs/TEST.dsgraph.gnuplot does not exist config.status: executing test/Programs/TEST.vtl.Makefile commands install: ../test...
2008 Jul 16
2
[PATCH] stopmachine: add stopmachine_timeout v2
...stop. This means all other healthy cpus will be blocked infinitely by one dead cpu. This patch allows stop_machine to return -EBUSY with some printk messages if any of stop_machine's threads cannot start running on its target cpu. v2: - remove fix for warning since it will be fixed upcoming typesafe patches - make stopmachine_timeout from secs to msecs, and set default to 200 msec (since v1's arbitrary 5 sec is too long) - allow disabling timeout by setting the stopmachine_timeout to 0 Signed-off-by: Hidetoshi Seto <seto.hidetoshi at jp.fujitsu.com> --- kernel/stop_machine...
2008 Jul 16
2
[PATCH] stopmachine: add stopmachine_timeout v2
...stop. This means all other healthy cpus will be blocked infinitely by one dead cpu. This patch allows stop_machine to return -EBUSY with some printk messages if any of stop_machine's threads cannot start running on its target cpu. v2: - remove fix for warning since it will be fixed upcoming typesafe patches - make stopmachine_timeout from secs to msecs, and set default to 200 msec (since v1's arbitrary 5 sec is too long) - allow disabling timeout by setting the stopmachine_timeout to 0 Signed-off-by: Hidetoshi Seto <seto.hidetoshi at jp.fujitsu.com> --- kernel/stop_machine...
2004 Sep 05
5
[LLVMdev] POST MORTEM: llvm-test changes
After the removal of llvm/test/Programs and insertion of llvm-test cvs module, the nightly tester showed the following: x86 Linux debug: * hard to say. I think it failed because the check in occurred just as it was starting up. Could someone verify for me? No results were produced. x86 Linux optimized: * everything ran okay * loc graph now shows 550k lines (up 350k!) - not sure
2011 Jan 12
1
[LLVMdev] About test suits
...`-- SSE | |-- Makefile | `-- Output | `-- sse.expandfft.ll |-- TEST.aa.Makefile |-- TEST.aa.report |-- TEST.buildrepo.Makefile |-- TEST.example.Makefile |-- TEST.jit.Makefile |-- TEST.jit.report |-- TEST.nightly.Makefile |-- TEST.nightly.report |-- TEST.typesafe.Makefile `-- TEST.vtl.Makefile 19 directories, 47 files -- Best regards, Li Qingan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110112/d701ecb6/attachment.html>
2008 Jul 17
1
[PATCH] stopmachine: add stopmachine_timeout v4
...timeout via sysctl. v4: - move extern into linux/stop_machine.h and add include of the header to kernel/sysctl.c. Now stopmachine_timeout is available only on smp. v3: - set stopmachine_timeout default to 0 (= never timeout) v2: - remove fix for warning since it will be fixed upcoming typesafe patches - make stopmachine_timeout from secs to msecs - allow disabling timeout by setting the stopmachine_timeout to 0 Signed-off-by: Hidetoshi Seto <seto.hidetoshi at jp.fujitsu.com> --- include/linux/stop_machine.h | 3 ++ kernel/stop_machine.c | 54 ++++++++++++++++++++...
2008 Jul 17
1
[PATCH] stopmachine: add stopmachine_timeout v4
...timeout via sysctl. v4: - move extern into linux/stop_machine.h and add include of the header to kernel/sysctl.c. Now stopmachine_timeout is available only on smp. v3: - set stopmachine_timeout default to 0 (= never timeout) v2: - remove fix for warning since it will be fixed upcoming typesafe patches - make stopmachine_timeout from secs to msecs - allow disabling timeout by setting the stopmachine_timeout to 0 Signed-off-by: Hidetoshi Seto <seto.hidetoshi at jp.fujitsu.com> --- include/linux/stop_machine.h | 3 ++ kernel/stop_machine.c | 54 ++++++++++++++++++++...
2008 Mar 15
4
[LLVMdev] improving the ocaml binding's type safety
I was talking to Gordon on #llvm earlier, and he challenged me with coming up with a way to improve the ocaml binding's type safety. We can't go letting haskell beat us now, can we? I think I got an easy solution with phantom types. For those who don't know what the problem is, the ocaml bindings share one type between whole class branches (like values). This means we need to downcast
2020 Apr 15
0
[PATCH 36/59] drm/cirrus: Don't use drm_device->dev_private
Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. Acked-by: Eric Anholt <eric at anholt.net> Acked-by: Sam Ravnborg <sam at ravnborg.org> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com> Cc: Dave Airlie <airlied at redhat.com> Cc: Gerd Hoffmann <kraxel at redhat...