LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-12-2005, 05:55 PM   #1
Last Attacker
Member
 
Registered: Jun 2004
Location: South Africa
Distribution: Ubuntu
Posts: 120

Rep: Reputation: 15
_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++ ?
 
Old 07-12-2005, 07:34 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration