heap - In linux (or POSIX) function similar to win32 mem api -


I am writing interpreted language on windows, and I use PAGE_GUARD Code> Hep Crelet for dynamic allocation of my language / Hiipalok

Maybe I have to lock my lang in other OS .. So, in Linux (or posics) standard ..), what's the same as these Win32 APIs? (I hope they are not very different to use ..)


OK, see below if you do not have these Win32 APIs:

HeapCreate - Create a new pile of simple:

  zero * mem = malloc (123); // Handle with ALLOC default heap HHPE = hepcat (...); // Make a new heap zero * mem2 = hepial (hhapa, some_flag, 123); // Illustrations with new Happ  

PAGE_GUARD - bit complex; It is used to implement the stack, for example, there is a stack, which has a maximum size of 5-page. To save memory, I will allot a single page and send only 4 pages of "reserved" virtual memory address.

  --------- | Light --------- | Reserved | --------- | Reserved | --------- | Reserved | --------- | Reserved | ---------  

When the first page of the stack is fully used, and the program is about to use more stacks, access violation can occur. After that, I will "commit" the second page and will continue the program.

PAGE_GUARD is only helpful to do this. (In Win95, there is no Page Guard of Win95 without this assistant) If I commit the second page "carefully" for the forward-time and mark the program more stack, then the garrulous exception occurs And un-mark the OS page itself as it is itself. I only have to commit and mark the next page.

Do not look for the exact similarity of Linux for every functionality of Win32 that you know or want Are there. Think basicly in Linux terms. Study as you do (see or search something).

And yes, Pozzics or Linux versus Windows is very different, especially for their perceptions etc ...

You probably want and; I do not know in all Windows (so I do not know what HeapCreate does).

The lower layer of cross-platform toolkit (e.g., QtCore ...) or ( Gtk ...) can help you.

Linux is often (but you can use some other, for example, which is very readable IMHO). It is used and implemented (especially, usually made up of ...).

If you get help, then get used to studying free software source code.

For BTW, an interpreter, you can consider using ...


Comments