mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
bug 551098 - windows mobile crashes on start up since xmalloc landing r=cjones
This commit is contained in:
parent
4e51434fc9
commit
daab44389b
@ -39,8 +39,6 @@
|
|||||||
#include "include/mozce_shunt.h"
|
#include "include/mozce_shunt.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "mozilla/mozalloc_macro_wrappers.h" /* infallible malloc */
|
|
||||||
|
|
||||||
#ifdef MOZ_MEMORY
|
#ifdef MOZ_MEMORY
|
||||||
|
|
||||||
// declare the nothrow object
|
// declare the nothrow object
|
||||||
@ -49,8 +47,6 @@ const std::nothrow_t std::nothrow;
|
|||||||
char*
|
char*
|
||||||
_strndup(const char *src, size_t len) {
|
_strndup(const char *src, size_t len) {
|
||||||
char* dst = (char*)malloc(len + 1);
|
char* dst = (char*)malloc(len + 1);
|
||||||
// FIXME/bug 507249: no need to null-check when infallible
|
|
||||||
// allocators are used
|
|
||||||
if(dst)
|
if(dst)
|
||||||
strncpy(dst, src, len + 1);
|
strncpy(dst, src, len + 1);
|
||||||
return dst;
|
return dst;
|
||||||
@ -66,8 +62,6 @@ _strdup(const char *src) {
|
|||||||
wchar_t *
|
wchar_t *
|
||||||
_wcsndup(const wchar_t *src, size_t len) {
|
_wcsndup(const wchar_t *src, size_t len) {
|
||||||
wchar_t* dst = (wchar_t*)malloc(sizeof(wchar_t) * (len + 1));
|
wchar_t* dst = (wchar_t*)malloc(sizeof(wchar_t) * (len + 1));
|
||||||
// FIXME/bug 507249: no need to null-check when infallible
|
|
||||||
// allocators are used
|
|
||||||
if(dst)
|
if(dst)
|
||||||
wcsncpy(dst, src, len + 1);
|
wcsncpy(dst, src, len + 1);
|
||||||
return dst;
|
return dst;
|
||||||
|
@ -47,6 +47,11 @@ ifdef MOZ_MEMORY
|
|||||||
DIRS += jemalloc
|
DIRS += jemalloc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef WINCE
|
||||||
|
# mozalloc depends on the shunt
|
||||||
|
DIRS += $(DEPTH)/build/wince/shunt
|
||||||
|
endif
|
||||||
|
|
||||||
DIRS += mozalloc
|
DIRS += mozalloc
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
@ -51,10 +51,8 @@ FORCE_SHARED_LIB= 1
|
|||||||
DIST_INSTALL = 1
|
DIST_INSTALL = 1
|
||||||
|
|
||||||
ifeq (,$(filter-out WINCE,$(OS_ARCH)))
|
ifeq (,$(filter-out WINCE,$(OS_ARCH)))
|
||||||
# The wince shunt relies on this library in a somewhat complicated
|
# mozalloc gets its allocation methods from the shunt, which gets their
|
||||||
# way. In wince builds, jemalloc replaces the wince libc allocators
|
# implementation by direcly linking with jemalloc.obj
|
||||||
# and moz_* will end up using those symbols at run time.
|
|
||||||
export NO_SHUNT = 1
|
|
||||||
OS_LIBS =
|
OS_LIBS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user