LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 05-21-2011, 10:29 PM   #1
GiangNV
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: Disabled
How to allocate a region of memories which similar VirtualAlloc


Hello.

I was looking for a method of allocating memories on Linux which similar VirtualAlloc on Windows. Requirements are:

1. Size of memories block to allocate is 2^16.
2. Address of memories block is larger than 0x0000ffff
3. Address of memories block must have last 16 bits are zero.

On Windows because lower limit of application address (lpMinimumApplicationAddress) we have (2) obvious right. From (1), (2) and system rules we also achieved (3).

Thanks for helping.
 
Old 05-21-2011, 10:50 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,240

Rep: Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322Reputation: 5322
Why?

This (previously posted) might help:

http://forums.pcsx2.net/Thread-blog-...Alloc-on-Linux

Last edited by dugan; 05-21-2011 at 11:08 PM.
 
1 members found this post helpful.
Old 05-21-2011, 11:10 PM   #3
GiangNV
LQ Newbie
 
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
I'm trying to implement memory pooling. Which each chunk meets requirements above I can get pointer to this by (blockPtr & 0xffff0000). This is useful when deallocate a block.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
PCI: Cannot allocate resource region 7 of bridge 0000:00:1c.0 kees1074 Linux - Hardware 2 09-15-2010 12:29 PM
PCI:Cannot allocate resource region? zeca_pedra Debian 0 02-16-2008 06:31 AM
PCI: Cannot allocate resource region 0 of device 0000:00:12.0 mvo Linux - Hardware 8 12-06-2007 11:12 AM
HELP ! Error PCI: can not allocate resource region 4 of device 00:05.1 mrdiwakar Linux - Hardware 1 03-16-2006 10:45 PM
PCI: Cannot allocate resource region 1 of device 0000:00:00.0 dbfoxnh Linux - Hardware 2 04-22-2005 10:01 AM

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

All times are GMT -5. The time now is 01:20 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