mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 20:22:00 +00:00
Bug 872577 - Using default resolution for free() instead of libc. r=nfroyd
--HG-- extra : rebase_source : 70884bd2b27ebf7c9ec2273e495808a655283c49
This commit is contained in:
parent
2d3fb3fa56
commit
ed9c8a89a4
@ -228,10 +228,25 @@
|
||||
return fd.dispose();
|
||||
};
|
||||
|
||||
UnixFile.free =
|
||||
libc.declare("free", ctypes.default_abi,
|
||||
/*return*/ ctypes.void_t,
|
||||
/*ptr*/ ctypes.voidptr_t);
|
||||
{
|
||||
// Symbol free() is special.
|
||||
// We override the definition of free() on several platforms.
|
||||
let default_lib = null;
|
||||
try {
|
||||
// On platforms for which we override free(), nspr defines
|
||||
// a special library name "a.out" that will resolve to the
|
||||
// correct implementation free().
|
||||
default_lib = ctypes.open("a.out");
|
||||
} catch (ex) {
|
||||
// On other platforms, well, use the regular version of free.
|
||||
default_lib = libc;
|
||||
}
|
||||
|
||||
UnixFile.free =
|
||||
default_lib.declare("free", ctypes.default_abi,
|
||||
/*return*/ ctypes.void_t,
|
||||
/*ptr*/ ctypes.voidptr_t);
|
||||
}
|
||||
|
||||
// Other functions
|
||||
UnixFile.access =
|
||||
|
Loading…
x
Reference in New Issue
Block a user