diff --git a/README.md b/README.md index 871ca79..c21bc20 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,103 @@ -libhmemory -========== \ No newline at end of file +# hmemory # + +hmemory is a memory error detector for c/c++ programs. + +1. overview +2. configuration +3. error reports +4. test cases +5. usage example +6. contact +7. license + +## 1. overview ## + +hmemory is a lightweight memory error detector for c/c++ programs, specifically designed for embedded systems. + +main use case may include embedded systems where valgrind - +addrcheck, or +memcheck support **is not** available. + +and has benefits of: + +* has a negligible effect run-time speed +* does not require any source code change +* operating system and architecture independent +* easy to use + +can detect errors of: + +- double/invalid free +- mismatched use of malloc versus free +- writing before or end of malloc'd blocks +- invalid realloc +- overlapping src and dst pointers in memcpy +- memory leaks + +## 2. configuration ## + +1. compile-time options +2. run-time options + +### 2.1. compile-time options ### + +hthread configuration parameters can be set using make flags, please check example section for demonstration. + +- HTHREAD_ENABLE_CALLSTACK + + default 1 + + enable/disable reporting call trace information on error, useful but depends on libbdf, libdl, and + backtrace function from glibc. may be disabled for toolchains which does not support backtracing. + +- HTHREAD_REPORT_CALLSTACK + + default 1 + + dump callstack info (function call history) for error point. + +- HTHREAD_ASSERT_ON_ERROR + + default 1 + + terminate the process on any pthreads api misuse and/or lock order violation. + +### 2.2. run-time options ### + +hthread reads configuration parameters from environment via getenv function call. one can either set/change environment +variables in source code of monitored project via setenv function call, or set them globally in running shell using +export function. + +please check example section for demonstration. + +- hthread_report_callstack + + default 1 + + dump callstack info (function call history) for error point. + +- hthread_assert_on_error + + default 1 + + terminate the process on any pthreads api misuse and/or lock order violation. + +## 3. error reports ## + +## 4. test cases ## + +## 5. usage example ## + +## 6. contact ## + +if you are using the software and/or have any questions, suggestions, etc. please contact with me at +alper.akcan@gmail.com + +## 7. license ## + +Copyright (C) 2008-2013 Alper Akcan + +This work is free. It comes without any warranty, to the extent permitted +by applicable law. You can redistribute it and/or modify it under the terms +of the Do What The Fuck You Want To Public License, Version 2, as published +by Sam Hocevar. See the COPYING file for more details.