[ET Trac] [Einstein Toolkit] #1432: CarpetLib::poison_new_memory when aligning memory
Einstein Toolkit
trac-noreply at einsteintoolkit.org
Wed Sep 4 15:02:08 CDT 2013
#1432: CarpetLib::poison_new_memory when aligning memory
--------------------+-------------------------------------------------------
Reporter: rhaas | Owner: eschnett
Type: defect | Status: new
Priority: major | Milestone:
Component: Carpet | Version: development version
Keywords: |
--------------------+-------------------------------------------------------
looking at the poison code in CarpetLib's mem.cc it seems to me that the
poisoning cdoe uses the wrong data pointer ie uses line 144 of mem.cc:
{{{
total_allocated_bytes += nbytes;
max_allocated_bytes = max (max_allocated_bytes,
total_allocated_bytes);
if (poison_new_memory) {
memset (storage_, poison_value, nbytes);
}
}}}
when in fact I think it should be {{{storage_base_}}} since this is the
pointer to nbytes bytes of memory returned by malloc.
Attached please find a patch which tries to address this. Note that this
only matters on systems where the vector lenght is large enough so that
the "natural" alignment provided by malloc (at least 4 bytes I'd assume
more likely actually 8 bytes).
--
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1432>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit
More information about the Trac
mailing list