抗锯齿 [英] anti-aliasing

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

问题描述

建议的新功能


int别名(void * ptr1,size_t len1,void * ptr1,size_t len2)


返回true如果指针重叠。


在大多数机器上,它可以简单地实现。但它必须是一个

标准库函数,因为从不同对象比较两个

地址不一定合法。


优势:


如果传递了不需要的别名,非智能实现只会执行用户的错误处理

代码。智能实现可以检测到两个指针不可能是别名,并生成moe

高效代码。


但是限制不会渗透到调用代码。没有

需要声明每个指针参数restict只是因为你在某处你b $ b调用一个库字符串副本。

A proposed new function

int alias(void *ptr1, size_t len1, void *ptr1, size_t len2)

Returns true if the pointers overlap.

On most machines it can be trivially implemented. However it has to be a
standard library function because it is not necessarily legal to compare two
address from different objects.

The advantages:

An unintelligent implementation simply executes the user''s error-handling
code if an unwanted alias is passed. An intelligent implementation can
detect that the two pointers cannot possibly be aliases, and generate moe
efficient code.

However the restrictions do not percolate up to calling code. There is no
need to declare every pointer parameter "restict" just because somewhere you
call a library string copy.

推荐答案

Malcolm McLean写道:
Malcolm McLean wrote:

建议的新函数


int别名(void * ptr1,size_t len1,void * ptr1,size_t len2)


如果指针重叠,则返回true。
A proposed new function

int alias(void *ptr1, size_t len1, void *ptr1, size_t len2)

Returns true if the pointers overlap.



谁将指定len1和len2参数?

Who will specify the len1 and len2 parameters?




" Malcolm McLean" < re ******* @ btinternet.com写信息

新闻:4 _ *********************** ******* @ bt.com ...

"Malcolm McLean" <re*******@btinternet.comwrote in message
news:4_******************************@bt.com...

>建议的新功能


int别名(void * ptr1,size_t len1,void * ptr1,size_t len2)


如果指针重叠,则返回true。


在大多数机器上可以琐碎实施。但是它必须是一个

标准库函数,因为从不同的对象中比较两个地址并不一定合法。


优势:


如果传递了不需要的别名,非智能实现只会执行用户的错误处理

代码。智能实现可以检测到两个指针不可能是别名,并生成moe

高效代码。


但是限制不会渗透到调用代码。没有

需要声明每个指针参数restict只是因为某个地方

你调用了一个库字符串副本。
>A proposed new function

int alias(void *ptr1, size_t len1, void *ptr1, size_t len2)

Returns true if the pointers overlap.

On most machines it can be trivially implemented. However it has to be a
standard library function because it is not necessarily legal to compare
two address from different objects.

The advantages:

An unintelligent implementation simply executes the user''s error-handling
code if an unwanted alias is passed. An intelligent implementation can
detect that the two pointers cannot possibly be aliases, and generate moe
efficient code.

However the restrictions do not percolate up to calling code. There is no
need to declare every pointer parameter "restict" just because somewhere
you call a library string copy.



不确定是否使用了这样的功能。别名是关于编译时间

优化。您希望编译器生成如下代码:


if(别名(...))

{

// do "缓慢"代码

}

其他

{

//做快"代码

}


不确定这是否会加快速度:)

Not sure about the use of such a function. aliasing is about compiletime
optimization. You want a compiler to generate code like:

if (alias(...))
{
// do "slow" code
}
else
{
// do "fast" code
}

not sure if that would speed things up :)


Malcolm McLean说:
Malcolm McLean said:

建议的新函数


int别名(void * ptr1,size_t len1,void * ptr1,size_t len2)
A proposed new function

int alias(void *ptr1, size_t len1, void *ptr1, size_t len2)



入侵我的命名空间。请将其称为其他内容,例如isalias。


谢谢。


-

Richard Heathfield

" Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上述域名中, - www。

invades my namespace. Please call it something else, e.g. isalias.

Thanks.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.


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

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