Closed Bug 1063726 Opened 10 years ago Closed 10 years ago

js/src/shell/js.cpp:6009:43: error: 'malloc_usable_size' was not declared in thi s scope

Categories

(Core :: JavaScript Engine, defect)

All
FreeBSD
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36
Tracking Status
firefox34 --- unaffected
firefox35 --- fixed
firefox36 --- fixed

People

(Reporter: jbeich, Assigned: jbeich)

References

Details

Attachments

(1 file, 1 obsolete file)

On FreeBSD malloc_usable_size() is declared in malloc_np.h.

js/src/shell/Unified_cpp_js_src_shell0.cpp:2:
js/src/shell/js.cpp:6009:12: error:
      use of undeclared identifier 'malloc_usable_size'
    return malloc_usable_size((void *) ptr);
           ^
1 error generated.

with already working example elsewhere

configure.in:
    MALLOC_HEADERS="malloc.h malloc_np.h malloc/malloc.h sys/malloc.h"
    MALLOC_H=

    for file in $MALLOC_HEADERS; do
      MOZ_CHECK_HEADER($file, [MALLOC_H=$file])
      if test "$MALLOC_H" != ""; then
        AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
        break
      fi
    done

memory/mozalloc/mozalloc.cpp:
    #if defined(MALLOC_H)
    #  include MALLOC_H             // for memalign, valloc, malloc_size, malloc_usable_size
    #endif // if defined(MALLOC_H)
    ...
    #if defined(XP_MACOSX)
        return malloc_size(ptr);
    #elif defined(HAVE_MALLOC_USABLE_SIZE) || defined(MOZ_MEMORY)
        return malloc_usable_size(ptr);
    #elif defined(XP_WIN)
        return _msize(ptr);
    #else
        return 0;
    #endif
> js/src/shell/js.cpp:
...
> #if defined(HAVE_MALLOC_USABLE_SIZE)
>     return malloc_usable_size((void *) ptr);
> #elif defined(HAVE_MALLOC_SIZE)

There's no corresponding AC_DEFINE or AC_CHECK_FUNC anywhere. Is that a nop intended to be fixed by another bug?

>     return malloc_size((void *) ptr);
> #else
>     return 0;
> #endif
> }
Comment on attachment 8485439 [details] [diff] [review]
Define MALLOC_H like top-level configure.in.

Oops, need to test more the fix is enough.
Attachment #8485439 - Attachment is obsolete: true
Attachment #8485439 - Flags: review?(mh+mozilla)
Attachment #8485439 - Flags: review?(jimb)
All those patches have been backed out, because... they caused compilation problems, as you noticed. Feel free to follow along in bug 1063247 as I make a second attempt.
rebased
Attachment #8492573 - Flags: review?(mh+mozilla)
Attachment #8492573 - Flags: review?(jimb)
Attachment #8492573 - Flags: review?(jimb) → review+
Comment on attachment 8492573 [details] [diff] [review]
Define MALLOC_H like top-level configure.in.

Adding an alternative reviewer. The regression may end up in Beta at this rate.

As the buildbot only builds m-c and m-a any regression stacking on top would be harder to notice.
Attachment #8492573 - Flags: review?(ted)
Attachment #8492573 - Flags: review?(ted) → review+
Assignee: nobody → jbeich
Keywords: checkin-needed
Comment on attachment 8492573 [details] [diff] [review]
Define MALLOC_H like top-level configure.in.

Approval Request Comment
[Feature/regressing bug #]: bug 1063247 regression
[User impact if declined]: Broken build on FreeBSD.
[Describe test coverage new/current, TBPL]: Green Try run in comment 6 and soon in inbound.
[Risks and why]: Low. At most may break build on other platforms.
[String/UUID change made/needed]: None
Attachment #8492573 - Flags: review?(mh+mozilla) → approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/97bee1976412
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Attachment #8492573 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.