Пример #1
0
STATIC void addhcstab(elem *e,int hash)
{ unsigned h = hcstop;

  if (h >= hcsmax)                      /* need to reallocate table     */
  {
        assert(h == hcsmax);
#if TARGET_MAC
        hcsmax += (hcsmax + 64);        /* This space is not returned */
                                        /* multiple reallocs costly */
#else
        // With 32 bit compiles, we've got memory to burn
        hcsmax += (__INTSIZE == 4) ? (hcsmax + 128) : 100;
#endif
        assert(h < hcsmax);
#if TX86
        hcstab = (hcs *) util_realloc(hcstab,hcsmax,sizeof(hcs));
#else
        hcstab = (hcs *) MEM_PARF_REALLOC(hcstab,hcsmax*sizeof(hcs));
#endif
        //printf("hcstab = %p; hcstop = %d, hcsmax = %d\n",hcstab,hcstop,hcsmax);
  }
  hcstab[h].Helem = e;
  hcstab[h].Hhash = hash;
  hcstop++;
}
Пример #2
0
Файл: cgcs.c Проект: Kozzi11/dmd
STATIC void addhcstab(elem *e,int hash)
{ unsigned h = hcsarray.top;

  if (h >= hcsmax)                      /* need to reallocate table     */
  {
        assert(h == hcsmax);
        // With 32 bit compiles, we've got memory to burn
        hcsmax += hcsmax + 128;
        assert(h < hcsmax);
#if TX86
        hcstab = (hcs *) util_realloc(hcstab,hcsmax,sizeof(hcs));
#else
        hcstab = (hcs *) MEM_PARF_REALLOC(hcstab,hcsmax*sizeof(hcs));
#endif
        //printf("hcstab = %p; hcsarray.top = %d, hcsmax = %d\n",hcstab,hcsarray.top,hcsmax);
  }
  hcstab[h].Helem = e;
  hcstab[h].Hhash = hash;
  hcsarray.top++;
}