Add an address predicate
This commit is contained in:
parent
7d621f82db
commit
88b2a72f07
2 changed files with 10 additions and 0 deletions
|
|
@ -2,6 +2,9 @@
|
|||
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- An `address?` predicate
|
||||
|
||||
### Fixed
|
||||
- `nil` was not considered a null pointer
|
||||
- Primitive-serializing types fail to compile as arguments to downcall handles
|
||||
|
|
|
|||
|
|
@ -130,6 +130,13 @@
|
|||
[addr]
|
||||
(or (.equals (MemoryAddress/NULL) addr) (not addr)))
|
||||
|
||||
(defn address?
|
||||
"Checks if an object is a memory address.
|
||||
|
||||
`nil` is considered an address."
|
||||
[addr]
|
||||
(or (nil? addr) (instance? MemoryAddress addr)))
|
||||
|
||||
(defn slice-global
|
||||
"Gets a slice of the global address space.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue