Skip to content

Commit 2c6762a

Browse files
committed
no message
1 parent c939ed8 commit 2c6762a

17 files changed

+2009
-273
lines changed

CHANGES

+69-29
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,69 @@
1-
2.2.2 Oops. Shared library must be position-independent code.
2-
3-
2.2.0
4-
Merge in bug-fixes, multi-thread patch, shared library patch,
5-
debian/ subdirectory used for building the Debian package
6-
7-
2.0.1
8-
Add work-arounds for kernel and library bugs under HP-UX.
9-
HP has been notified and will repair these soon.
10-
11-
2.0.2
12-
Add support for DEC Alpha. Add %a pattern for printing addresses, which
13-
assumes they are passed in a void *.
14-
15-
2.0.3 30-Sep-1993
16-
When realloc is passed a zero address, it should work the same
17-
way as malloc(). Fix forward declaration of mprotect() in page.c to
18-
use void *, not caddr_t, for addresses. IRIX 5.0.1 complained about that.
19-
20-
2.0.4 29-May-1994
21-
Don't attempt to allow access to a zero-sized page when
22-
EF_ALLOW_MALLOC_0 is set. Attempt to un-map memory from
23-
Page_Delete(). If that doesn't work, fall back by protecting the
24-
page from all references. Un-mapping small segments of a mapping
25-
used to crash my SGI IRIX 5.0 system. I assume that nobody is running
26-
5.0 any longer.
27-
28-
2.0.5 20-January-1995
29-
Port to Linux.
1+
2+
TODO:
3+
modification of Makefile since 2.2.2
4+
modification of manual page efence.3.
5+
6+
7+
2.4.4 several modifications
8+
seperation of c++ files: efencepp.h, efencepp.cpp
9+
renamed EF_push()/EF_pop() to EF_newFrame()/EF_delFrame()
10+
new compile option "EF_NO_LEAKDETECTION"
11+
new compile option "EF_NO_CPP"
12+
splitted efence.h to efence.h and efenceint.h
13+
added Copyright and License information to many files
14+
renamed COPYING to COPYING-GPL
15+
(2002-11-03, HA)
16+
17+
2.4.3 added following PreProcessor Macros for Release and Debug Mode
18+
#define NEW_ELEM(TYPE) new TYPE
19+
#define NEW_ARRAY(TYPE,COUNT) new (TYPE)[COUNT]
20+
#define DEL_ELEM(PTR) delete PTR
21+
#define DEL_ARRAY(PTR) delete []PTR
22+
which are mapped to malloc() and free() in Debug Mode.
23+
Use these macros to get filename and linenumber of a C++ style memory leak.
24+
(2002-10-07, HA)
25+
26+
2.4.2 added support for implicit and explicit leak checking:
27+
void EF_push(void) creates a new memory frame.
28+
void EF_pop(void) checks for memory leaks allocated after EF_push().
29+
this function is called automatically onexit(), even without EF_push().
30+
(2002-10-07, HA)
31+
32+
2.4.1 Port to Windows (NT/2000/XP) by adding sections to following functions
33+
Page_AllowAccess(), Page_Create(), Page_Delete(), Page_DenyAccess(), Page_Size()
34+
(2002-10-06, HA)
35+
36+
2.4.0 added support for C++ operators new, new[], delete and delete[]
37+
(2002-10-03, HA)
38+
39+
40+
41+
2.2.2 Oops. Shared library must be position-independent code.
42+
43+
2.2.0
44+
Merge in bug-fixes, multi-thread patch, shared library patch,
45+
debian/ subdirectory used for building the Debian package
46+
47+
2.0.1
48+
Add work-arounds for kernel and library bugs under HP-UX.
49+
HP has been notified and will repair these soon.
50+
51+
2.0.2
52+
Add support for DEC Alpha. Add %a pattern for printing addresses, which
53+
assumes they are passed in a void *.
54+
55+
2.0.3 30-Sep-1993
56+
When realloc is passed a zero address, it should work the same
57+
way as malloc(). Fix forward declaration of mprotect() in page.c to
58+
use void *, not caddr_t, for addresses. IRIX 5.0.1 complained about that.
59+
60+
2.0.4 29-May-1994
61+
Don't attempt to allow access to a zero-sized page when
62+
EF_ALLOW_MALLOC_0 is set. Attempt to un-map memory from
63+
Page_Delete(). If that doesn't work, fall back by protecting the
64+
page from all references. Un-mapping small segments of a mapping
65+
used to crash my SGI IRIX 5.0 system. I assume that nobody is running
66+
5.0 any longer.
67+
68+
2.0.5 20-January-1995
69+
Port to Linux.

COPYING COPYING-GPL

File renamed without changes.

COPYING-LGPL

+504
Large diffs are not rendered by default.

README

+108-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,106 @@
1+
2+
Electric Fence - Red-Zone memory allocator.
3+
Copyright (C) 1987-1999 Bruce Perens <[email protected]>
4+
Copyright (C) 2002 Hayati Ayguen <[email protected]>, Procitec GmbH
5+
License: GNU GPL (GNU General Public License, see COPYING-GPL) for all files except efencepp.h
6+
License: GNU LGPL (GNU Lesser General Public License, see COPYING-GPL) for efencepp.h
7+
8+
--- GPL --
9+
10+
This program is free software; you can redistribute it and/or modify
11+
it under the terms of the GNU General Public License as published by
12+
the Free Software Foundation; either version 2 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU General Public License for more details.
19+
20+
You should have received a copy of the GNU General Public License
21+
along with this program; if not, write to the Free Software
22+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23+
24+
--- LGPL --
25+
26+
This library is free software; you can redistribute it and/or
27+
modify it under the terms of the GNU Lesser General Public
28+
License as published by the Free Software Foundation; either
29+
version 2.1 of the License, or (at your option) any later version.
30+
31+
This library is distributed in the hope that it will be useful,
32+
but WITHOUT ANY WARRANTY; without even the implied warranty of
33+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34+
Lesser General Public License for more details.
35+
36+
You should have received a copy of the GNU Lesser General Public
37+
License along with this library; if not, write to the Free Software
38+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39+
40+
---
41+
42+
43+
This is Electric Fence 2.4
44+
45+
Added Port to Windows from Electric Fence 2.2.2.
46+
47+
Here some Compilation Notes for your Application in Debug Mode
48+
for the Microsoft Visual C++ (v6) Compiler:
49+
50+
1) don't use Program Database for "Edit and Continue":
51+
Project-Options -> C++ -> General -> Debug-Info
52+
2) don't use the "multithreaded-dll" runtime library:
53+
Project-Options -> C++ -> Code Generation -> Runtime library
54+
3) switch off incremental linking
55+
Project-Options -> Linker -> General
56+
4) add following Linker option "/FORCE:MULTIPLE"
57+
Project-Options -> Linker -> General
58+
59+
the labels may differ a bit cause i'm using the german version:
60+
61+
german options:
62+
1) Projekteinstellungen -> C++ -> Kategorie =Allgemein -> Debug-Info =Programmdatenbank
63+
2) Projekteinstellungen -> C++ -> Kategorie =Codegeneration -> Laufzeitbibliothek anpassen (Release/Debug),
64+
nicht die DLL-Variante verwenden
65+
3) Projekteinstellungen -> Linker -> Kategorie =Allgemein - Inkrementelles Binden =Aus
66+
4) Projekteinstellungen -> Linker -> Projekt Optionen
67+
"/FORCE:MULTIPLE" unten eingeben
68+
69+
now everything you have to do is to set a dependency to "efence" from your application.
70+
71+
Leak Detection:
72+
---------------
73+
all memory allocation is protocoled from Electric Fence together with the filename/linenumber
74+
of the caller. atexit() it is checked if each allocated memory block was freed; if not an error
75+
occurs.
76+
with EF_newFrame() and EF_delFrame you can create a new memory frame. embracing a smaller (than
77+
the whole program) unit with these functions, you can check if the leak is in that smaller unit.
78+
to disable leak detection add following preprocessor definition
79+
EF_NO_LEAKDETECTION
80+
81+
C++ memory operators and leak detection:
82+
----------------------------------------
83+
cause the c++ memory operators are syntactically different from normal functions there was the
84+
need for a different kind of solution:
85+
the following macros got introduced
86+
1) NEW_ELEM(TYPE)
87+
2) NEW_ARRAY(TYPE,COUNT)
88+
3) DEL_ELEM(PTR)
89+
4) DEL_ARRAY(PTR)
90+
to use Electric Fence functionality you have to replace new/new[]/delete/delete[] by these
91+
macros. these macros respect the EF_NO_LEAKDETECTION definition. because these macros need
92+
the change of your source to take effect, you have to include <efencepp.h>. to avoid rechange
93+
of your code these macros are expanded to "normal" new/delete when compiling release code.
94+
this is also the reason why solely efencepp.h is put under LGPL.
95+
to disable c++ new/delete/new[]/delete[] operator overload add following preprocessor definition
96+
EF_NO_CPP
97+
98+
99+
Hayati Ayguen
100+
101+
102+
---
103+
1104
This is Electric Fence 2.2
2105

3106
Electric Fence is a different kind of malloc() debugger. It uses the virtual
@@ -17,7 +120,8 @@ efence.3 .
17120
There is a mailing list to support Electric Fence. You can subscribe to it
18121
using the web form at http://lists.perens.com/mailman/listinfo/electric-fence.
19122

20-
Thanks
21-
22-
Bruce Perens
23-
123+
Thanks
124+
125+
Bruce Perens
126+
127+

0 commit comments

Comments
 (0)