~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/completion_hash.cc

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *
18
18
 * by  Andi Gutmans <andi@zend.com>
19
19
 * and Zeev Suraski <zeev@zend.com>
20
 
 * Small portability changes by Monty.
 
20
 * Small portability changes by Monty. Changed also to use my_malloc/my_free
21
21
 */
22
22
 
23
23
#include "client_priv.h"
24
24
#include <mystrings/m_string.h>
 
25
#undef SAFEMALLOC                               // Speed things up
25
26
#include "completion_hash.h"
26
27
 
27
28
uint hashpjw(const char *arKey, uint nKeyLength)
40
41
 
41
42
int completion_hash_init(HashTable *ht, uint nSize)
42
43
{
43
 
  ht->arBuckets = (Bucket **) malloc(nSize* sizeof(Bucket *));
44
 
  memset(ht->arBuckets, 0, nSize* sizeof(Bucket *));
 
44
  ht->arBuckets = (Bucket **) my_malloc(nSize* sizeof(Bucket *),
 
45
                                        MYF(MY_ZEROFILL | MY_WME));
45
46
 
46
47
  if (!ht->arBuckets)
47
48
  {
211
212
void completion_hash_free(HashTable *ht)
212
213
{
213
214
  completion_hash_clean(ht);
214
 
  free(ht->arBuckets);
 
215
  my_free(ht->arBuckets, MYF(0));
215
216
}
216
217
 
217
218