summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2011-11-22 13:09:57 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-11-29 16:07:37 -0600
commitd809e799a62a43472c10e4567c313d575ea29734 (patch)
treeda849d3f99f126113856a9d0007e824a8e297715 /src/usr/hwpf
parentbbf8689af866146b80dcc932c72e1fd021056dcf (diff)
downloadtalos-hostboot-d809e799a62a43472c10e4567c313d575ea29734.tar.gz
talos-hostboot-d809e799a62a43472c10e4567c313d575ea29734.zip
HWPF: Demonstrate the use of a heap based array in a HWP
Change-Id: I32680803dece8c748c2d45ca8099a8612db1fc58 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/513 Tested-by: Jenkins Server Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf')
-rwxr-xr-xsrc/usr/hwpf/hwp/fapiTestHwpAttr.C6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/usr/hwpf/hwp/fapiTestHwpAttr.C b/src/usr/hwpf/hwp/fapiTestHwpAttr.C
index 8c6b117ad..0f58479c5 100755
--- a/src/usr/hwpf/hwp/fapiTestHwpAttr.C
+++ b/src/usr/hwpf/hwp/fapiTestHwpAttr.C
@@ -41,6 +41,7 @@
* mjjones 10/28/2011 Fix error generation
* camvanng 11/09/2011 Update attr enum test
* mjjones 11/17/2011 Removed some initfile attr tests
+ * mjjones 11/22/2011 Demonstrate use of heap based array
*/
#include <fapiTestHwpAttr.H>
@@ -622,7 +623,8 @@ fapi::ReturnCode hwpTestAttributes()
// Test ATTR_SCRATCH_UINT64_ARRAY_1
//----------------------------------------------------------------------
{
- uint64_t l_uint64array1[4];
+ // Demonstrate the use of a heap based array
+ uint64_t (&l_uint64array1)[4] = *(reinterpret_cast<uint64_t(*)[4]>(new uint64_t[4]));
// Test set
for (uint32_t i = 0; i < 4; i++)
@@ -679,6 +681,8 @@ fapi::ReturnCode hwpTestAttributes()
FAPI_ERR("hwpTestAttributes: ATTR_SCRATCH_UINT64_ARRAY_1. Error from SET (2)");
break;
}
+
+ delete [] &l_uint64array1;
}
//----------------------------------------------------------------------
OpenPOWER on IntegriCloud