Skip to content

Commit

Permalink
Merge pull request BinaryAnalysisPlatform#50 from maverickwoo/memory-…
Browse files Browse the repository at this point in the history
…size

introduce Memory.size (resolve BinaryAnalysisPlatform#48)
  • Loading branch information
ivg committed Dec 22, 2014
2 parents 5d37f73 + 48988fd commit d80f3cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/bap_image/bap_memory.ml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ let max_addr t : addr =
let n = t.size - 1 in
Addr.(t.addr ++ n)

let size t : int = t.size

let one_byte_getters data addr pos =
let byte = Word.of_int ~width:8 in
let make read =
Expand Down
3 changes: 3 additions & 0 deletions lib/bap_image/bap_memory.mli
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ val (^!) : t -> addr -> word
val max_addr : t -> addr
val min_addr : t -> addr

(** [size] returns the size of the memory *)
val size : t -> int

(** [contains mem addr] returns true if [mem] contains address [addr] *)
val contains : t -> addr -> bool

Expand Down

0 comments on commit d80f3cd

Please sign in to comment.