357871 pthread_spin_destroy not properly wrapped
357887 Fix a file handle leak. VG_(fclose) did not close the file
358030 support direct socket calls on x86 32bit (new in linux 4.3)
+359133 Assertion 'eltSzB <= ddpa->poolSzB' failed
n-i-bz Fix incorrect (or infinite loop) unwind on RHEL7 x86 32 bits
n-i-bz massif --pages-as-heap=yes does not report peak caused by mmap+munmap
ht_node *ht_ins;
vg_assert(ddpa);
vg_assert(ddpa->ht_elements);
- vg_assert (eltSzB <= ddpa->poolSzB);
ddpa->nr_alloc_calls++;
and insert it in the hash table of inserted elements. */
// Add a new pool or grow pool if not enough space in the current pool
- if (UNLIKELY(ddpa->curpool_free == NULL
- || ddpa->curpool_free + eltSzB - 1 > ddpa->curpool_limit)) {
- ddpa_add_new_pool_or_grow (ddpa);
+ if (eltSzB + ddpa->eltAlign > ddpa->poolSzB) {
+ // Element (+eltAlign for worst case) bigger than the pool size
+ // => allocate a specific pool just for this element
+ UChar *newpool = ddpa->alloc_fn (ddpa->cc, eltSzB + ddpa->eltAlign);
+ /* add to our collection of pools */
+ VG_(addToXA)( ddpa->pools, &newpool );
+ elt_ins = ddpa_align (ddpa, newpool);
+ } else {
+ if (UNLIKELY(ddpa->curpool_free == NULL
+ || ddpa->curpool_free + eltSzB - 1 > ddpa->curpool_limit)) {
+ ddpa_add_new_pool_or_grow (ddpa);
+ }
+ elt_ins = ddpa->curpool_free;
+ ddpa->curpool_free = ddpa_align(ddpa, ddpa->curpool_free + eltSzB);
}
- elt_ins = ddpa->curpool_free;
- VG_(memcpy)(elt_ins, elt, eltSzB);
- ddpa->curpool_free = ddpa_align(ddpa, ddpa->curpool_free + eltSzB);
+ VG_(memcpy)(elt_ins, elt, eltSzB);
ht_ins = VG_(allocEltPA) (ddpa->ht_node_pa);
ht_ins->key = ht_elt.key;
ht_ins->eltSzB = eltSzB;