Jump to content

Search the Community

Showing results for tags 'y*'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. Hello, I am getting a memory exception when parsing numpy data buffers passed using the PyArg_ParseTuple() method. I am using C++Builder in 11.3. I updated my P4D yesterday, using the auto installer and code from the master repo. My code on the C++ end is: PPyObject array1( PPyObject self, PPyObject args ) { TPythonEngine * eng = GetPythonEngine(); unsigned int i1; unsigned long num_points; double * data; int ret = eng->PyArg_ParseTuple(args,"y*",&data); // copy data num_points = python_interface::num_points; for (i1=0; i1<num_points; i1++) python_interface::test_array1[i1] = *(data+i1); return eng->ReturnNone(); } on the python side I have: import numpy as np import python_module num_pts = 10 python_module.array_size(num_pts) test_arr1 = np.linspace(1.0,10.0,num_pts,dtype=float) python_module.array1(test_arr1.data) test_arr2 = np.linspace(2.0,20.0,num_pts,dtype=float) python_module.array2(test_arr2.data) The data is passed fine, and the values are consistent. The exception occurs when the ReturnNone() call is made. Project p4d.exe raise exception class $C0000005 with message 'access violation at 0x00c1d000: read of address 0x000000b8'. Exception occurs regardless of whether or not data is copied. The script does not continue pass this point, and returns the exception so the second array is never passed. Any ideas? Please let me know if you need any other info, and any help would be appreciated.
×