mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-05 21:07:52 +00:00
addded cvs id tags
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@380 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
5a1d151a58
commit
c493fe416f
16
src/hash.c
16
src/hash.c
@ -1,3 +1,19 @@
|
||||
/* ------------------------------------------------------
|
||||
* Open-addressed hash using double hash probing
|
||||
*
|
||||
* for i in 0 to m-1:
|
||||
* h(k, i) = ( h1(k) + i*h2(k) ) mod m
|
||||
*
|
||||
* requires: 1) m must be a power of two
|
||||
* 2) h2(k) must return an odd number
|
||||
*
|
||||
* Besed on code published in _Mastering Algorithms in C_
|
||||
* by Kyle Loudon (O'Reilly 1999).
|
||||
* Modified by Philip Kovacs (kovacsp3@comcast.net)
|
||||
*
|
||||
* $Id$
|
||||
* ------------------------------------------------------ */
|
||||
|
||||
#ifdef HASH_DEBUG
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
@ -1,6 +1,3 @@
|
||||
#ifndef HASH_H
|
||||
#define HASH_H
|
||||
|
||||
/* ------------------------------------------------------
|
||||
* Open-addressed hash using double hash probing
|
||||
*
|
||||
@ -13,8 +10,13 @@
|
||||
* Besed on code published in _Mastering Algorithms in C_
|
||||
* by Kyle Loudon (O'Reilly 1999).
|
||||
* Modified by Philip Kovacs (kovacsp3@comcast.net)
|
||||
*
|
||||
* $Id$
|
||||
* ------------------------------------------------------ */
|
||||
|
||||
#ifndef HASH_H
|
||||
#define HASH_H
|
||||
|
||||
typedef struct _hash_table_t {
|
||||
int positions;
|
||||
int size;
|
||||
|
@ -3,6 +3,8 @@
|
||||
*
|
||||
* Copyright (C) 2005 Philip Kovacs kovacsp3@comcast.net
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
@ -425,7 +427,7 @@ void show_connection_to_tcp_port_monitor(
|
||||
* connection limit. Future versions should probably allow the client to set the hash size
|
||||
* and load limits and/or provide for automatic resizing of hashes. */
|
||||
|
||||
if ( (double)p_monitor->hash.size / (double)p_monitor->hash.positions > TCP_CONNECTION_HASH_MAX_LOAD_PCT )
|
||||
if ( (double)p_monitor->hash.size / (double)p_monitor->hash.positions >= TCP_CONNECTION_HASH_MAX_LOAD_PCT )
|
||||
{
|
||||
/* hash exceeds our load limit is now "full" */
|
||||
return;
|
||||
|
@ -3,6 +3,8 @@
|
||||
*
|
||||
* Copyright (C) 2005 Philip Kovacs kovacsp3@comcast.net
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
|
Loading…
Reference in New Issue
Block a user