Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 965139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:56:46+00:00 2026-05-16T01:56:46+00:00

I have the following function: void CGlEngineFunctions::GetBezierOpposite( const POINTFLOAT &a,const POINTFLOAT &center, POINTFLOAT &b,

  • 0

I have the following function:

void CGlEngineFunctions::GetBezierOpposite( const POINTFLOAT &a,const POINTFLOAT &center, POINTFLOAT &b, float blength )
{


    POINTFLOAT v;
    v.x = a.x - center.x;
    v.y = a.y - center.y;

    float alength = GetDistance(a,center);

    if(blength == 0)
    {
        blength = alength;
    }

    float multiplier = blength / alength;

    b.x = center.x - multiplier * v.x;
    b.y = center.y - multiplier * v.y;

}

I have narrowed the problem down to the least 2 lines:

b.x = center.x - multiplier * v.x;
b.y = center.y - multiplier * v.y;

Every time I call this repeatedly, memory shots up until it crashes.

I use it like this:

glEngine.functions.GetBezierOpposite(usrpt[0].LeftHandle,
            usrpt[0].UserPoint,usrpt[0].RightHandle,0);

I really do not see how this could cause any problems.
To test, I changed it to this:

void CGlEngineFunctions::GetBezierOpposite( const POINTFLOAT &a,const POINTFLOAT &center, POINTFLOAT &b, float blength )
{


    POINTFLOAT v;
    v.x = a.x - center.x;
    v.y = a.y - center.y;

    float alength = GetDistance(a,center);

    if(blength == 0)
    {
        blength = alength;
    }

    float multiplier = blength / alength;

    b.x = 5;
    b.y = 5;

}

When I do this it has absolutely no issues. I do not see how doing arithmetic can cause the memory usage to shoot up.

Thanks

could it be cause if alength and blength = 0?

POINTFLOAT:
float x;
float y;
  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:56:47+00:00Added an answer on May 16, 2026 at 1:56 am

    If the GetDistance calls this method, there may be a Stack Overflow.

    If other threads call this method, there may be a Stack Overflow.

    Check the POINTFLOAT definition. IMHO, it should be modified to provide subtraction operations. You should not need to reference any of the structure’s members. But then this comment would be about C++.

    You should remove the ‘C’ language tag, since the C language does not provide a scope resolution operator, ‘::’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function with the following declaration: void cleanValid(int valid[][4], int &size, int
I have the following function: void Register(Data* _pData, uint32 _Line, const char* _pFile, ...)
I have the following function/constructor/method (I'm not sure exactly what it is) List<T>& List<T>::operator=(const
I have a following inline function: inline void normalizeGrayOutputCentredSigmoide(const type meanValue=(type)0.0, const type sensitivity=(type)2.0,
Consider the following function prototypes: void Remove(SomeContainer& Vec, const std::size_t Index); SomeContainer Remove(SomeContainer Vec,
I have 2 C++ DLLs. One of them contains the following function: void init(const
I have the following function void AddNodeValue(XMLNode& node, std::string& value); I want to use
I have the following function void initBoard(int * board[BOARD_ROWS][BOARD_COLS]){ int z = 0; for(
I have following function in one Activity public void AppExit() { Editor edit =
I have the following simple function: private void EnableDisable941ScheduleBButton() { if (this._uosDepositorFrequency.Value != null)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.