packet.hh (10563:755b18321206) packet.hh (10564:a8c16e2d466a)
1/*
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 800 unchanged lines hidden (view full) ---

809 dataStatic(T *p)
810 {
811 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA|ARRAY_DATA));
812 data = (PacketDataPtr)p;
813 flags.set(STATIC_DATA);
814 }
815
816 /**
1/*
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 800 unchanged lines hidden (view full) ---

809 dataStatic(T *p)
810 {
811 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA|ARRAY_DATA));
812 data = (PacketDataPtr)p;
813 flags.set(STATIC_DATA);
814 }
815
816 /**
817 * Set the data pointer to the following value that should not be
818 * freed. This version of the function allows the pointer passed
819 * to us to be const. To avoid issues down the line we cast the
820 * constness away, the alternative would be to keep both a const
821 * and non-const data pointer and cleverly choose between
822 * them. Note that this is only allowed for static data.
823 */
824 template <typename T>
825 void
826 dataStaticConst(const T *p)
827 {
828 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA|ARRAY_DATA));
829 data = const_cast<PacketDataPtr>(p);
830 flags.set(STATIC_DATA);
831 }
832
833 /**
817 * Set the data pointer to a value that should have delete []
818 * called on it.
819 */
820 template <typename T>
821 void
822 dataDynamicArray(T *p)
823 {
824 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA|ARRAY_DATA));

--- 172 unchanged lines hidden ---
834 * Set the data pointer to a value that should have delete []
835 * called on it.
836 */
837 template <typename T>
838 void
839 dataDynamicArray(T *p)
840 {
841 assert(flags.noneSet(STATIC_DATA|DYNAMIC_DATA|ARRAY_DATA));

--- 172 unchanged lines hidden ---