帮助req。为标题 [英] Help req. for a header

查看:98
本文介绍了帮助req。为标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Turbo C ......进行项目(案例研究)我需要sys / mman.h .....我必须使用它中的一些函数.....但它是不是在我的Turbo C编译器库中.......我在哪里可以找到这个标题?哪个编译器?


Thanx

解决方案

这不是标准的标题,你可以尝试谷歌搜索它。


但我已经尝试使用大量关键字进行Google搜索...我没有在谷歌搜索之前发布这条简单的消息....请告诉我在哪里可以得到这些非标准的标题.....


如何使用标准C进行内存映射?好吧,我正在尝试编写一个文本编辑器并使其适用于大尺寸文件,我正在考虑将内存映射文件.....


另一个问题是如果我用fread()读取缓冲区中文件的内容,内核是否能够交换当另一个程序试图访问内存时,缓冲区的部分会释放一些内存吗?

等待回复


Thanx



但我已经尝试使用大量关键字进行谷歌搜索.....我没有在谷歌搜索之前发布这个简单的消息....请告诉我在哪里可以获得这些非标准标题.....



对不起,有多少人不会感到惊讶。 />

我通过Googling找到了sys / mman.h的相关信息,但我不确定这对你来说是否是最好的解决方案。

< blockquote class =post_quotes>
如何使用标准C进行内存映射?好吧,我正在尝试编写一个文本编辑器,并使其适用于大尺寸文件,我在想内存映射文件.....



我认为文件的内存映射是由Windows API提供的,如果您正在为Windows查找MapViewOfFile或启动这里


另一个问题是,如果我使用fread()读取缓冲区中文件的内容,内核是否能够交换当另一个程序试图访问内存时缓冲区的部分释放一些内存?



没有keneral只能翻转整个缓冲区,它是全部或全部。


自你正在编辑文本文件,文件不太可能很大。我可能不会担心只是通过常规方法分配一大块足以包含文件的内存。


I m using Turbo C......for a project(case study) i require sys/mman.h .....i have to use some functions present in it.....but it is not in my Turbo C compiler library.......where can i find this header?? which compiler??

Thanx

解决方案

That is not a standard header, you could try googling for it.


But I''ve tried googling with a lot of keywords..... I haven''t had posted this simple message before googling .... Please kindly tell me where can i get these non standard headers.....

How can i do memory mapping with standard C? Well I''m trying to code a text editor and to make it work on large size files,I was thinking to memory map the files.....

Another question is that if i read the contents of a file in a buffer with fread(),will the kernel able to "swap" the parts of buffer to release some memory when another program tries to access memory?

Waiting for reply

Thanx


But I''ve tried googling with a lot of keywords..... I haven''t had posted this simple message before googling .... Please kindly tell me where can i get these non standard headers.....

Sorry you''d be surprised how many people don''t.

I found relevent information by Googling for "sys/mman.h", however I am not sure that will necessarily be the best solution for you.

How can i do memory mapping with standard C? Well I''m trying to code a text editor and to make it work on large size files,I was thinking to memory map the files.....

I think memory mapping of files is something that is provided by the Windows API if you are writing for Windows look up MapViewOfFile or start here

Another question is that if i read the contents of a file in a buffer with fread(),will the kernel able to "swap" the parts of buffer to release some memory when another program tries to access memory?

No the keneral will only be able to swop the whole buffer, it''s all or nothing.

Since you are editing text files it is unlikely that the files wil be very big. I would probably not worry about just allocating a chunk of memory large enough to contain the file through normal methods.


这篇关于帮助req。为标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆