aboutsummaryrefslogtreecommitdiffstats
path: root/epan/emem.c
AgeCommit message (Collapse)AuthorFilesLines
2006-11-11fix so that tcp.pdu.time works again.Ronnie Sahlberg1-1/+22
it broken in one of the previous bugfixes to tcp add a function to print an emem tree to the console for easier emem tree debugging svn path=/trunk/; revision=19877
2006-08-17add trees with PErmanent allocation scope which will be useful for constructingRonnie Sahlberg1-0/+17
associative arrays for globally unique and persistent mappings such as oid to name sid to name guid to name svn path=/trunk/; revision=18937
2006-08-14make creation of subtrees used for the _array tree type use the same ↵Ronnie Sahlberg1-15/+35
allocation scope as its parent and thus become allocation scope agnostic change all accessor functions to be defines to the emem_tree_ functions. now to create a tree with a different scope we only need to create a new ..._tree_create() function and set up the appropriate defines (it was a mistake to call the functions se_tree_create and se_tree_create_non_persistent, they should be the other way around i.e. se_tree_create_persistent and se_tree_create ) svn path=/trunk/; revision=18895
2006-08-14rename some structures and defines from the se_tree to the emem_tree prefixRonnie Sahlberg1-80/+80
svn path=/trunk/; revision=18894
2006-08-12put a memory allocator function pointer inside the tree structure so that ↵Ronnie Sahlberg1-6/+8
all accessor functions become storage scope agnostic svn path=/trunk/; revision=18888
2006-08-12rename some inline functions from se_ to emem_ prefix as a first step to ↵Ronnie Sahlberg1-15/+15
generalize teh tree management and to use trees with different storage scope without too much code duplication. it would be useful with a tree that had indefinite storage instead of the emem functions which commonly have ep or se storage scope. indefinite storage scope would be useful for example for managing a global and static set of well known guid to name mappings(not yet implemented) and also for oid to name mappings. svn path=/trunk/; revision=18886
2006-06-20From Albert Chin:Anders Broman1-6/+16
Fix some C++ comments in C source files and fixes some non-constant initializations. svn path=/trunk/; revision=18521
2006-06-17Not all UN*Xes have MAP_ANONYMOUS; some have MAP_ANON instead, and someGuy Harris1-1/+20
have neither. For those with MAP_ANON but not MAP_ANONYMOUS, use MAP_ANON; for those with neither, add some code to use "/dev/zero". svn path=/trunk/; revision=18488
2006-06-16From Albert Chin Jaap Keuter1-1/+1
HP-UX doesn't have MAP_ANON but it does have MAP_ANONYMOUS. Moreoever, according to mmap(2) on RHEL: MAP_ANONYMOUS The mapping is not backed by any file; the fd and offset argu- ments are ignored. This flag in conjunction with MAP_SHARED is implemented since Linux 2.4. MAP_ANON Alias for MAP_ANONYMOUS. Deprecated. svn path=/trunk/; revision=18486
2006-05-31Tethereal/tethereal -> TShark/tshark.Gerald Combs1-2/+2
svn path=/trunk/; revision=18268
2006-05-28Ethereal->WiresharkAnders Broman1-3/+3
svn path=/trunk/; revision=18234
2006-05-21name changeRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18197
2006-05-18Improve fix for Bug 915 by using GetVersionEx() as it is recommended by ↵Lars Roland1-7/+12
Microsoft. Tested on Win98 SE. svn path=/trunk/; revision=18183
2006-05-17attempt to fix #915:Ulf Lamping1-2/+6
if the GetVersionEx() call fails, force the dwPlatformId to VER_PLATFORM_WIN32_WINDOWS so the return value from VirtualProtect() won't trigger an assert. svn path=/trunk/; revision=18178
2006-05-15Change return value checking to the true meaning of the spec:Jaap Keuter1-2/+2
"If the function succeeds, the return value is nonzero." This may or may not solve bug 915. svn path=/trunk/; revision=18168
2006-05-02Not all compilers support unnamed struct/union fields withinGuy Harris1-13/+13
structs/unions (GCC supports it "for compatibility with other compilers"; presumably that's not for compatibility with the version of Sun C that rejected it - was that a PCCism?). svn path=/trunk/; revision=18072
2006-04-28Fix logic used to test protection under Windows OT. Only initializeGerald Combs1-14/+27
our page size and OS version information once. svn path=/trunk/; revision=18025
2006-04-26If we're running under Windows 95/98/Me, don't abort if we can't protectGerald Combs1-15/+21
our guard pages. svn path=/trunk/; revision=18011
2006-03-18rename se_tree_lookup32_less_than_or_equal()Ronnie Sahlberg1-1/+1
to se_tree_lookup32_le() svn path=/trunk/; revision=17664
2006-03-18add new se_tree_lookup32_less_than_or_equal() callRonnie Sahlberg1-0/+88
svn path=/trunk/; revision=17663
2006-03-11revert back to svn 17587Ronnie Sahlberg1-18/+59
svn path=/trunk/; revision=17597
2006-03-11oops removed one check too manyRonnie Sahlberg1-0/+3
when we lookup grandparent, check that we actually have a grandparent. svn path=/trunk/; revision=17596
2006-03-11remove some redundant calls and checks and pass the required pointers as ↵Ronnie Sahlberg1-59/+15
parameters instead to make it slightly faster svn path=/trunk/; revision=17589
2006-03-11give se_trees names so that it is easier to debug and to log how often ↵Ronnie Sahlberg1-3/+5
certain trees are accessed svn path=/trunk/; revision=17587
2006-03-11forgot to paint a node causing massively unbalanced treeRonnie Sahlberg1-28/+27
svn path=/trunk/; revision=17575
2006-03-10avoid doing the lookup of a key twice while inserting items to a tree with ↵Luis Ontanon1-5/+85
an array key. svn path=/trunk/; revision=17570
2006-03-10fix missing return bug from didierRonnie Sahlberg1-1/+1
svn path=/trunk/; revision=17564
2006-03-10make using canaries optionalRonnie Sahlberg1-3/+49
default to use-canaries since that is the current behaviour svn path=/trunk/; revision=17563
2006-03-10add a define that controls explicitely whether we want to use guard pages ↵Ronnie Sahlberg1-11/+18
(if available) or not. let it default to want-guard-pages since the existing code does that. svn path=/trunk/; revision=17562
2006-03-07From Jeff Morriss:Gerald Combs1-19/+35
emem.c wouldn't compile with EP_DEBUG_FREE and SE_DEBUG_FREE defined. The attached patch fixes that and cleans up some warnings that showed up with those two were defined, too. (In fact 95% of the patch is for warnings.) Fix up whitespace. svn path=/trunk/; revision=17500
2006-03-07Rename set_string_hash... into se_tree_xxx_string as proposed by ronnie for ↵Luis Ontanon1-7/+2
consistency whith its real nature. svn path=/trunk/; revision=17496
2006-03-07use an elaborated key for the string keyed "hash table"Luis Ontanon1-54/+60
svn path=/trunk/; revision=17491
2006-03-07Add a hash table with string keys based on the red/black tree.Luis Ontanon1-0/+70
svn path=/trunk/; revision=17485
2006-03-06add helper to build (red/black) trees from a key that is a vector of guin32 ↵Ronnie Sahlberg1-1/+67
arrays. test this functionality by calling these vector insert/lookup tree functions from the nfs dissector for when filehandles are used as a key. these vector functions could also be used to efficiently store conversations : se_tree_key_t[6] = { { addr_len/4, &src_addr }, { addr_len/4, &dst_addr }, { 1, &src_port32 }, { 1, &dst_port32 }, { 1, &protocol32 }, { 0, NULL } } (the nfs dissector needs a LOT of work. It is very painful to work with very large nfs traces with all the memory it wastes (and eats) as well as how slow all the tables make it) svn path=/trunk/; revision=17477
2006-03-05initial implementation of binary tree support with se allocation scopeRonnie Sahlberg1-0/+326
this is to test out a basic implementation of binary trees and the api required for the helpers svn path=/trunk/; revision=17467
2006-03-03Use intptr_t for int-to-pointer conversions.Gerald Combs1-4/+6
svn path=/trunk/; revision=17457
2006-02-27Add guard pages to emem.c. GP memory is protected using mprotect()Gerald Combs1-19/+92
under UNIX and VirtualProtect() under Windows. This probably breaks compatibility with Windows 95/98/ME. svn path=/trunk/; revision=17424
2006-02-23Print an error when we detect memory corruption. Fix a typo in a comment.Gerald Combs1-5/+5
svn path=/trunk/; revision=17395
2006-02-14Have the emem.c memdup routines accept and return "void *", asGuy Harris1-2/+2
"memcpy()" does; that eliminates some compiler warnings ("void *" is the type usually used for "generic pointer"). svn path=/trunk/; revision=17297
2006-01-18In packet-cops.c use proto_item_append_text() instead of creating aGerald Combs1-0/+2
separate buffer. Fixes the current Buildbot failure. Don't let the sprint_realloc_* functions reallocate ep_allocated memory. Add comments warning against this in the future. In emem.c, make sure we don't use an extra 100k every stinkin' time someone wants to allocate memory when debugging is enabled. Fixup whitespace. svn path=/trunk/; revision=17051
2006-01-11Pass the correct arguments to fopen().Gerald Combs1-1/+1
svn path=/trunk/; revision=17002
2006-01-11Fix compiling under GLib 1, squelch a gcc warning.Gerald Combs1-3/+5
svn path=/trunk/; revision=16998
2006-01-10Close "/dev/urandom" if we manage to open it.Gerald Combs1-0/+1
svn path=/trunk/; revision=16990
2006-01-10Allocate memory on 8-byte boundaries again. Tweak the way we Gerald Combs1-60/+80
fill the canary data. svn path=/trunk/; revision=16989
2006-01-10Allowing pointer arithmetic on "void *"s is a GCCism; cast "void *"s toGuy Harris1-2/+2
"char *" before adding an offset to them. svn path=/trunk/; revision=16985
2006-01-09Add canary values after each allocation. If our canaries values don'tGerald Combs1-81/+151
match when we call {ep|se}_free_all(), throw an assertion. svn path=/trunk/; revision=16984
2005-12-09if passed a NULL string, make se_strdup() return the static stringRonnie Sahlberg1-1/+9
"<NULL>" instead of dumping. This allows callers to not have to check if the string is NULL or not. This fixes bugs 614 615 617 620 621 and 623 svn path=/trunk/; revision=16752
2005-10-10Add "ep_strdup_vprintf()" and "se_strdup_vprintf()", for completeness.Guy Harris1-16/+38
Make them not reuse a va_list; there's no guarantee that it can be used more than once and, in fact, on some platforms, you *can't* use it more than once. Based on a patch by Pekka Pietikainen. Clean up indentation a bit. svn path=/trunk/; revision=16174
2005-10-08make .._strndup() not to call strndup.Luis Ontanon1-10/+14
svn path=/trunk/; revision=16167
2005-10-06ep_strndup and se_strndup do not have to expect strings to be null terminated.Luis Ontanon1-8/+0
svn path=/trunk/; revision=16144