LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   _expand() and _msize() (https://www.linuxquestions.org/questions/programming-9/_expand-and-_msize-342600/)

Last Attacker 07-12-2005 05:55 PM

_expand() and _msize()
 
In windows I could use _expand() to take a piece of memory and enlarge it and _msize() to determine what the memory size in bytes (which I got from malloc.h, I think) is but in Linux I got compiling errors with those 2 functions.

I just want to know if there are Linux equivalent functions for C++ ?

jtshaw 07-12-2005 07:34 PM

In general you should be using new and delete in C++ to allocate memory.

However... if your interested... the following C functions exist under Linux.

malloc - allocates memory
realloc - reallocates a memory block (allows you to change the size).
malloc_size - reports the size of a block you have allocated

EDIT: btw... they are all availible in stdlib.h.


All times are GMT -5. The time now is 04:04 PM.