How exactly the new() function is allocating memory in systemverilog

Can anyone please tell me how exactly the new() method is allocating memory?
I’m using it almost everywhere but don’t know the implementation code for this method.

Thanks in advance…!

Regards
Sumanth

In reply to SATYA369:

Each simulator vendor is free to implement the new method any way they see fit, so long as it conforms to the LRM. Its performance characteristics should not typically influence how you write your SystemVerilog code.

In reply to sbellock:

Can you give me the sample(need not to be the exact) implementation code for the new() function,to understand better what’s happening inside.

Thank you,
Regards
Sumanth

In reply to SATYA369:

It’s either malloc or something similar to malloc, where malloc could be owned by the operating system or C library, or the simulator vendor could implements its own version.

In reply to SATYA369:

SystemVerilog is designed to keep all the details of memory management away from the user. There are no pointers or pointer operations. There is no possibly of accessing memory improperly. You just need to know that when calling new(), it returns a handle to an instance of an object. SystemVerilog always knows which class type created the instance.