From a22e53002f109b2d09dafbeb0ebdb83d16103612 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Fri, 17 Sep 2021 10:48:35 -0500 Subject: [PATCH] Add a null address predicate --- src/coffi/ffi.clj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/coffi/ffi.clj b/src/coffi/ffi.clj index 61fea3e..9b0b23e 100644 --- a/src/coffi/ffi.clj +++ b/src/coffi/ffi.clj @@ -87,6 +87,11 @@ [addressable] (.address ^Addressable addressable)) +(defn null? + "Checks if a memory address is null." + [addr] + (.equals (MemoryAddress/NULL) addr)) + (defn slice-global "Gets a slice of the global address space.