Commit 5c836e2a authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1

into  perch.ndb.mysql.com:/home/jonas/src/mysql-4.1-push
parents c3d07de0 e358a817
.TH WHICH 1 "20 December 2000"
.SH NAME
which - Jani please supply one.
.SH USAGE
which [options] [--] programname [...]
.SH SYNOPSIS
.B which
.RB [ \-\-version | \-[vV] ]
.RB [ \-\-skip\-dot ]
.RB [ \-\-skip\-tilde ]
.RB [ \-\-show\-dot ]
.RB [ \-\-show\-tilde ]
.RB [ \-\-tty\-only ]
.RB [ \-\-all | \-a ]
.RB [ \-\-read\-alias | \-i ]
.RB [ \-\-skip\-alias ]
.SH DESCRIPTION
.TP
.BR which
supports by executing
.TP
.BR \-\-version | \-[vV]
Print version and exit successfully.
.TP
.BR \-\-skip\-dot
Skip directories in PATH that start with a dot.
.TP
.BR \-\-skip\-tilde
Skip directories in PATH that start with a tilde.
.TP
.BR \-\-show\-dot
Don\'t expand a dot to current directory in output.
.TP
.BR \-\-show\-tilde
Output a tilde for HOME directory for non-root.
.TP
.BR \-\-tty\-only
Stop processing options on the right if not on tty.
.TP
.BR \-\-all | \-a
Print all matches in PATH, not just the first
.TP
.BR \-\-read\-alias | \-i
Read list of aliases from stdin.
.TP
.BR \-\-skip\-alias
Ignore option
.BR --read-alias;
don\'t read stdin.
.SH "SEE ALSO"
isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), mysqld_safe (1), which1 (1), zap (1),
.SH AUTHOR
Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com)
.\" end of man page
\ No newline at end of file
......@@ -257,7 +257,8 @@ NdbImpl::NdbImpl(Ndb_cluster_connection *ndb_cluster_connection,
: m_ndb_cluster_connection(ndb_cluster_connection->m_impl),
m_dictionary(ndb),
theCurrentConnectIndex(0),
theNdbObjectIdMap(1024,1024),
theNdbObjectIdMap(ndb_cluster_connection->m_impl.m_transporter_facade->theMutexPtr,
1024,1024),
theNoOfDBnodes(0)
{
int i;
......
......@@ -30,7 +30,7 @@ class NdbObjectIdMap //: NdbLockable
{
public:
STATIC_CONST( InvalidId = ~(Uint32)0 );
NdbObjectIdMap(Uint32 initalSize = 128, Uint32 expandSize = 10);
NdbObjectIdMap(NdbMutex*, Uint32 initalSize = 128, Uint32 expandSize = 10);
~NdbObjectIdMap();
Uint32 map(void * object);
......@@ -46,14 +46,16 @@ private:
void * m_obj;
} * m_map;
NdbMutex * m_mutex;
void expand(Uint32 newSize);
};
inline
NdbObjectIdMap::NdbObjectIdMap(Uint32 sz, Uint32 eSz) {
NdbObjectIdMap::NdbObjectIdMap(NdbMutex* mutex, Uint32 sz, Uint32 eSz) {
m_size = 0;
m_firstFree = InvalidId;
m_map = 0;
m_mutex = mutex;
m_expandSize = eSz;
expand(sz);
#ifdef DEBUG_OBJECTMAP
......@@ -131,21 +133,26 @@ NdbObjectIdMap::getObject(Uint32 id){
inline void
NdbObjectIdMap::expand(Uint32 incSize){
NdbMutex_Lock(m_mutex);
Uint32 newSize = m_size + incSize;
MapEntry * tmp = (MapEntry*)malloc(newSize * sizeof(MapEntry));
MapEntry * tmp = (MapEntry*)realloc(m_map, newSize * sizeof(MapEntry));
if (m_map) {
memcpy(tmp, m_map, m_size * sizeof(MapEntry));
free((void*)m_map);
if (likely(tmp != 0))
{
m_map = tmp;
for(Uint32 i = m_size; i<newSize; i++){
m_map[i].m_next = i + 1;
}
m_firstFree = m_size;
m_map[newSize-1].m_next = InvalidId;
m_size = newSize;
}
m_map = tmp;
for(Uint32 i = m_size; i<newSize; i++){
m_map[i].m_next = i + 1;
else
{
ndbout_c("NdbObjectIdMap::expand unable to expand!!");
}
m_firstFree = m_size;
m_map[newSize-1].m_next = InvalidId;
m_size = newSize;
NdbMutex_Unlock(m_mutex);
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment