由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 新手,一个C 库的问题
相关主题
请教个C++编程思路在线等两个问题
A malloc/free question using C/C++bloomberg onsite
在子函数内开内存,返回主函数指针然后释放空间是不是很糟糕的(转载)问个malloc问题
定义一个数组, 巨简单的一个问题内存泄露题一般怎么回答啊?
我最喜欢问的问题,怎样检查out of memory问一个C的简单问题
JP Morgan phone interview questionsQUALCOMM一题
Bloomberg Phone Interviewc interview question
求助:面试题Google
相关话题的讨论汇总
话题: third话题: party话题: free话题: dll话题: 静态
进入JobHunting版参与讨论
1 (共1页)
s*******8
发帖数: 12734
1
【 以下文字转载自 Programming 讨论区 】
发信人: story9988 (小小故事人), 信区: Programming
标 题: 新手,一个C 库的问题
发信站: BBS 未名空间站 (Wed Apr 18 09:30:38 2012, 美东)
我用了第三方的dll
这个硬件相关的dll是一些api, 其中有一个 third_party_allocate()
third_party_free()
这个dll静态连接了一个C library
所以这个 third_party_allocate(), third_party_free()就是wrap了
c的malloc(), free()
借口,参数类型,完全一样,当然,third_party_xxx()调用的是他静态连接里面的
c library.
我在程序里用系统的C 库里面的 free(p)
来释放 third_party_malloc()返回的p
结果异常被throw了,
为什么呢?
这个free()和他们本身的是一样的。
唯一差别一个是静态连接到她们自己的dll里面的
请高手指点
p*****2
发帖数: 21240
2

debug一下,看看third_party_allocate返回的地址周围有没有什么特殊情况。但是我
不明白为什么不用他们的函数free。

【在 s*******8 的大作中提到】
: 【 以下文字转载自 Programming 讨论区 】
: 发信人: story9988 (小小故事人), 信区: Programming
: 标 题: 新手,一个C 库的问题
: 发信站: BBS 未名空间站 (Wed Apr 18 09:30:38 2012, 美东)
: 我用了第三方的dll
: 这个硬件相关的dll是一些api, 其中有一个 third_party_allocate()
: third_party_free()
: 这个dll静态连接了一个C library
: 所以这个 third_party_allocate(), third_party_free()就是wrap了
: c的malloc(), free()

s*******8
发帖数: 12734
3
thanks for reply
actually it is not my code ...
that's why...

【在 p*****2 的大作中提到】
:
: debug一下,看看third_party_allocate返回的地址周围有没有什么特殊情况。但是我
: 不明白为什么不用他们的函数free。

r*****k
发帖数: 1281
4
why not using third_party_free()?
s*******8
发帖数: 12734
5
not my code.
the reason is that the original author thinks "third_party_free"
causes problems

【在 r*****k 的大作中提到】
: why not using third_party_free()?
1 (共1页)
进入JobHunting版参与讨论
相关主题
Google我最喜欢问的问题,怎样检查out of memory
报个电面的面经和据信吧, 求安慰JP Morgan phone interview questions
求问CC150书上16.9的“multiple of alignment”是什么意思??Bloomberg Phone Interview
Windows下多个DLL之间memory allocation问题 (转载)求助:面试题
请教个C++编程思路在线等两个问题
A malloc/free question using C/C++bloomberg onsite
在子函数内开内存,返回主函数指针然后释放空间是不是很糟糕的(转载)问个malloc问题
定义一个数组, 巨简单的一个问题内存泄露题一般怎么回答啊?
相关话题的讨论汇总
话题: third话题: party话题: free话题: dll话题: 静态